michaelfox + text   77

Tabs in Textarea Plugin for Javascript jQuery
Tabs in Textarea Plugin for Javascript jQuery
concept

This is a demo of the "Tabby" Javascript jQuery plugin to use tabs in regular textareas to make them suitable for in-browser coding of languages like HTML, CSS, Javascript, or your favorite server-side language. The idea is to be able to use a press of the TAB button or SHIFT+TAB to indent or outdent your code.

try it out!

Simply use TAB to indent code in the textarea, SHIFT+TAB to outdent. It works on a single line or over a range of lines.
jquery  plugin  tabs  textarea  javascript  text  editor  cursor  selection  range 
june 2011 by michaelfox
Pandoc - About pandoc
If you need to convert files from one markup format into another, pandoc is your swiss-army knife. Need to generate a man page from a markdown file? No problem. LaTeX to Docbook? Sure. HTML to MediaWiki? Yes, that too. Pandoc can read markdown and (subsets of) reStructuredText, textile, HTML, and LaTeX, and it can write plain text, markdown, reStructuredText, HTML, LaTeX, ConTeXt, PDF, RTF, DocBook XML, OpenDocument XML, ODT, GNU Texinfo, MediaWiki markup, textile, groff man pages, Emacs org-mode, EPUB ebooks, and S5 and Slidy HTML slide shows. PDF output (via LaTeX) is also supported with the included markdown2pdf wrapper script.

Pandoc understands a number of useful markdown syntax extensions, including document metadata (title, author, date); footnotes; tables; definition lists; superscript and subscript; strikeout; enhanced ordered lists (start number and numbering style are significant); delimited code blocks; markdown inside HTML blocks; and TeX math. Other options include “smart” punctuation, syntax highlighting, automatically generated tables of contents, and automatically generated citations (using citeproc-hs). If strict markdown compatibility is desired, all of these extensions can be turned off with a command-line flag.

Pandoc includes a Haskell library and a standalone executable. The library includes separate modules for each input and output format, so adding a new input or output format just requires adding a new module.
html  latex  markdown  markup  pdf  textile  text  convert  docbook 
april 2011 by michaelfox
Cocoa Text System
Apple’s Cocoa text system is a complicated beast, but also extremely flexible, and with a bit of work, it can be molded to match many working styles. This how-to covers the 2 major ways of customizing the text input system: Default key bindings, and for still more control, input managers.

I’m writing this guide because nothing like it currently exists. There is incredible room for flexibility in customizing the Cocoa text environment, but most users—even power-users—have no idea of the available options. This is mostly because Apple’s documentation is 1) aimed at developers, and 2) often incomplete or ambiguous. Most users have no idea that they can look at a file which describes all of the shortcuts on the system, and that they can easily add their own shortcuts, or replace existing ones with differing functionality.

For instance, one of the most common complaints from new Windows and Linux/Unix switchers is that many of the shortcuts they are used to, such as using the Home and End keys to move to the beginning, respectively end, of a line or document, don’t work as they expect in OS X.

For new users, almost every text box you use is a Cocoa text box (or close enough to act the same as far as we’re concerned) — Safari web form boxes, the text field in iChat for sending new messages, the documents in Pages or TextEdit, the email composer in Mail, etc. Note: Some text boxes are not Cocoa however, so the tricks in this article still aren’t completely universal. Notably, Microsoft Word, Adobe applications, AppleWorks, and the text fields in Camino and Firefox won’t work with this hint.

I expect that all users of OS X can get something out of this guide. I’m starting with the basics, so that new users, unfamiliar with the terminal and the intricacies of OS X can be brought up to speed. But even the most experienced users should hopefully learn something from this article; I know I learned several new nifty things while writing it.

Disclaimer: it is possible, when mucking around with the text system, to send applications messages they aren’t expecting. This can cause them to crash. As long as you stick to standard text selectors, you should be fine, but I’m not responsible if your program crashes because of a binding you add.
bindings  cocoa  keybindings  keyboard  text  osx  mac  programming  development  textmate  input  editing  system  hack  productivity  editor  howto  tutorial  reference   
october 2010 by michaelfox
pixelmatrix's autoSize at master - GitHub
autoSize

Basic idea: You’ve got text that needs to fit within certain bounds. You design it to look a certain way, but what if it’s too long? What if it’s too short? autoSize lets you set up classes so you can control the size at all times.
Practical uses

Blog posts: You’ve got a 10 word post and a 500 word post. use autoSize to set up a class for each, and style them appropriately (making the short post with a large font, and the 500 word post with a small font).

Tablular Content: You have 50px of space, and the content could be 5 characters or 10 characters. Add classes for each situation, and style them so that no matter what, the content will fit, and look great for each.

Text in boxes: You have a box, and you need the text to fit inside the box. Set up your classes, and style them appropriately.
javascript  jquery  text  font  size 
october 2010 by michaelfox
gist: 603087 - GitHub
(function(window, document, undefined){

// !incomplete

var comments = [];

function hideComments(content){

var c = -1;

return content
.replace(/(\/\/.*?)\n/g, '__c{$1}') // find '// comment' and replace with placeholder
.replace(/\n/g,'\uffff') // replace new lines chars so we can match over multi lines
.replace(/(\/\*.*?\*\/)/g, '__c{$1}') // find '/* comment */' and replace with placeholder
.replace(/__c\{(.*?)\}/g, function(x, y){ // find placeholder comment and store comment content

comments[++c] = y;

return '__c{' + c + ';}';
})
.replace(/\uffff/g,'\n'); // replace newline placeholder with actual newline
}

function restoreComments(content){

return content
.replace(/__c\{([0-9]+);\}/g, function(x, y){ // find placeholder comments and replace with comment content

return '\n' + comments[y].replace(/\uffff/g,'\n') + '\n';
});
}

function cleanWhitespace(content){

return content

.replace(/\s/g, ' ') // convert all whitespace to normal space char
.replace(/ {2,}/g, ' ') // convert multiple consecutive space chars to one space char
.replace(/([:;]) /g, '$1') // remove space after semi-colons
.replace(/ ([:;])/g, '$1') // remove space before semi-colons
.replace(/\s+([\{\}])/g, '$1') // remove space before braces
.replace(/([\{\}])\s+/g, '$1') // remove space after braces
.replace(/\}/g, '}\n') // add newline after brace
.replace(/([^;])\}/g, '$1;}') // add semicolon before brace
;
}

document.getElementById('clean').onclick = function(){

var content = document.getElementById('content').value;

content = hideComments(content);

content = cleanWhitespace(content);

content = restoreComments(content);

document.getElementById('content').value = content;
};


})(window, document);
gist-603087  gist  formatting  text  regex  javascript 
october 2010 by michaelfox
danvk.org » Character Palette Bookmarklet
Select the character you like and either copy/paste it or drag it where you like. Then click “Close” to make the palette go away until you need it again. Enjoy!
javascript  bookmarklets  characters  entities  symbols  glyphs  palette  typography  text  tools 
october 2010 by michaelfox
Textual excavation.
Greetings!

And welcome to the online experiment that I call TextExcavation.

The purpose of this site is to delve deeply into the extant texts of the ancient Judeo-Christian tradition. This deep delving into the texts is what I like to call textual excavation. (For the sake of consistent reference, TextExcavation is the name of this site, while textual excavation is the name of the research and methodology that is supposed to take place on this site.)

My focus is the foundational generation of Christianity, that of Jesus and the apostles. The texts that I shall examine are those that may shed light on that time period, whether those texts be Jewish or Christian. Each text must be examined with two goals in mind:

1. To determine its meaning for its own generation.
2. To determine its meaning for the first Christian generation.

Each text, therefore, serves as a window both into its own time and into the time of Jesus and the apostles. We must never forget the former as we excavate the texts, but our focus is the latter.

Which leads us to the important question...:
What is textual excavation?

I derive the term, of course, from the field of archaeology (though this metaphor for textual study is hardly my own invention). An excavation is a dig, and the purpose is to find artifacts, or items of historical interest.

But the archaeologist never stops at the finding of an artifact. He or she also presents the findings of the expedition to the rest of the archaeological world.

Similarly, the purpose of textual excavation is twofold:

1. Discover the phenomena latent in the text.
2. Publish these phenomena in easily accessible form.

The web is, in my judgment, an ideal medium for both of these steps. There is a number of sites and applications that can help with the second step, presenting textual data on the web, and there are even more sites and applications that can help with the first step, searching the texts.
Discovery.

Sifting through the extant texts is the first step in textual excavation. The archaeological excavator uses shovel and trowel. The textual excavator uses concordance, lexicon, monograph, article, and dictionary.

He or she can also use, as never before, computers and the internet to help with some of the research, including but not limited to online texts in the original or in translation, search sites and software, and the results of the study and scholarship of others on the web.
bible  text  tools  excavation  history  jesus  christian  religion  religious 
july 2010 by michaelfox
Advanced Regular Expression Tips and Techniques | Nettuts+
Regular Expressions are the Swiss Army knife for searching through information for certain patterns. They have a wide arsenal of tools, some of which often go undiscovered or underutilized. Today I will show you some advanced tips for working with regular expressions.
regex  text  strings  cheatsheet  php  reference 
april 2010 by michaelfox
Speed-up jQuery with jString - Vancouver Drupal Development, Alfresco Development and iPhone Development from Appnovation
The idea is to add jQuery-like methods to the String base class. These methods make what I call 'jString' or 'jQuery methods for Strings'. For building HTML, I found that I could get most of the work done with only five methods (empty, html, wrap, addClass and attr) so only these ones are currently implemented.
strings  text  regex  javascript  jquery  performance  tools  library 
april 2010 by michaelfox
15 PHP regular expressions for web developers
Regular expressions are a very useful tool for developers. They allow to find, identify or replace text, words or any kind of characters. In this article, I have compiled 15+ extremely useful regular expressions that any web developer should have in his toolkit.
code  php  regex  regexp  webdev  toolkit  *todo  text 
april 2010 by michaelfox
Regex Powertoy (interactive regular expressions)
Enter a regular expression in the top text area; matching occurs immediately. Double-click in this bottom area to enter target input to match. As soon as you tab, [esc], or click out of the bottom area, matching will begin. You can choose between Perl/PHP-like or Java regular expression syntax, and whether the target text is highlighted to show matches, edits, replacements, or splits. The 'animate' option lets you watch the regex engine at work. Creating a 'matchmark' sends your browser to a bookmarkable URI that will reproduce the current regex pattern, settings, and target text.
ajax  regex  regexp  tools  testing  text 
april 2010 by michaelfox

related tags

*todo  ajax  analysis  analytics  api  app  applescript  apps  archive  art  ascii  att  automator  background  backup  BBEdit  bestpractices  bible  bindings  blacktext  blog  bookmarklets  characters  charactersets  cheatsheet  christian  clean  cli  click  cloud  cocoa  code  collaboration  collection  color  control  convert  converter  copy  css  css3  csv  cursor  data  design  detection  development  diagram  docbook  editing  editor  ee  effect  email  emails  encode  encoding  entities  escape  events  example  excavation  expressionengine  figlet  finder  flow  font  format  formatting  forms  framework  fulltext  games  generator  gist  gist-603087  github  glyphs  google  grep  hack  heuristics  hex  history  howto  html  html5  hyphen  input  inset  inspiration  ios  ipad  iphone  ipsum  javascript  jesus  jquery  justify  key  keybindings  keyboard  label  language  latex  library  lifehacker  list  lorem  mac  macros  mail  mapreduce  markdown  markup  matrix  maxlength  md5  mongo  mongodb  mouse  msword  multipart  natural  node  nodejs  notepad  notes  npm  objective-c  ocr  office  online  opensource  organization  osx  palette  parse  parser  parsing  paste  pdf  performance  photoshop  php  phrase  placeholder  plaintext  plugin  plugins  processing  productivity  programming  python  quicksilver  r  range  reference  regex  regexp  religion  religious  research  resources  review  rpg  script  scripting  scripts  search  security  selection  service  services  shadow  shell  shortcut  shortcuts  showcase  size  smartquotes  sms  snippets  software  sort  space  spam  standard  statistics  string  strings  style  sublime  symbols  system  tabs  test  testing  text  text-shadow  textarea  texteditor  textile  textmate  textreplacement  tidy  toolkit  tools  truncation  tutorial  typography  ultimatebuild  unicode  unix  urls  userscripts  utf8  utilities  utility  visualization  web2.0  webdesign  webdev  widget  window  word  words  wordwrap  wrap  wrapping  writing  xcode   

Copy this bookmark:



description:


tags: