This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fredrick Ring - http://groups.google.com/group/jquery-en/browse_thread/thread/6902e3e091ec9e4b/f8a135f66d533265?pli=1 | |
Ok, I did it myself (+ the web). In case anyone is interested: | |
function wrapAsLink(url){ | |
var textarea = document.getElementById("myTa"); | |
var len = textarea.value.length; | |
var start = textarea.selectionStart; | |
var end = textarea.selectionEnd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'), | |
jsdom = require("jsdom"), | |
sys = require('sys'); | |
request({uri:'http://www.google.com/'}, function (error, response, body) { | |
console.log('Initial Response Received'); | |
if (!error && response.statusCode == 200) {; | |
var doc = jsdom.jsdom(body); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
font-face("fontawesome","fontawesome-webfont") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
// General Variables and RegEx | |
var mobileCookie = readCookie("mw_mobile_site"); | |
var regExUA = /ip(hone|od)|android.*(mobile)|blackberry.*applewebkit/i; | |
var regExDomain = /^(www(\d+)?\.)?(.*)$/; | |
var regExCookieDomain = /^(www(\d+)?\.)?(m.*\.)?(.*\.\w{3})$/; | |
// Build the top level domain | |
var hostname = window.location.hostname; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ziptastic.new.lookup "48073" | |
=> {"city"=>"Royal Oak", "country"=>"US", "county"=>"Oakland", "state"=>"Michigan", "state_short"=>"MI", "postal_code"=>"48073"} | |
Ziptastic.new.lookup "garbage" | |
=> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../polymer/polymer.html"> | |
<polymer-element name="selector-examples"> | |
<template> | |
<style> | |
.list { | |
display: block; | |
border-top-width: 1px; | |
border-right-width: 1px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Nationbuilder does not accept slugs that have uppercase letters. If they are used then a the 404 page for the theme used is shown | |
E.G. This link will work | |
www.mysite.nationbuilder.com/valid | |
This link will **not** work | |
www.mysite.nationbuilder.com/Valid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Uses UIActionSheet+blocks | |
UIActionSheet *as = [[UIActionSheet alloc] initWithTitle:@"Save before leaving?" | |
delegate:nil | |
cancelButtonTitle:NSLocalizedString(@"CancelBtnText", nil) | |
destructiveButtonTitle:nil | |
otherButtonTitles:@"Yes",@"No",nil ]; | |
as.destructiveButtonIndex = 1; | |
as.tapBlock = ^(UIActionSheet *actionSheet, NSInteger buttonIndex){ | |
NSLog(@"Chose %@", [actionSheet buttonTitleAtIndex:buttonIndex]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var requireDirectory = require('require-directory'); | |
var renamer = function (name) { | |
return name.replace(/-([a-z])/g, function (m, c) { | |
return c.toUpperCase(); | |
}); | |
}; | |
module.exports = requireDirectory(module, {rename: renamer}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias gs='git status' | |
alias gd='git diff' | |
alias ga='git add' | |
alias gn="git ls-files -m | head -1" | |
alias gnd='gn | xargs git diff' | |
alias gna='gn | xargs git add; gs; gnd' | |
alias gnp='git push origin HEAD' | |
# dangerous so commented out by default | |
#alias gnc='gn | xargs git checkout' |
OlderNewer