This file contains hidden or 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
for f in `ls *.psd` | |
do | |
convert "${f}[0]" `echo $f | sed 's/.psd/.png/'` | |
done |
This file contains hidden or 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
server { | |
listen 80; | |
server_name ksloan.net; | |
root /home/kevin/app/public; | |
location / { | |
try_files $uri @backend; | |
} |
This file contains hidden or 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
// Node.js CheatSheet. | |
// Download the Node.js source code or a pre-built installer for your platform, and start developing today. | |
// Download: http://nodejs.org/download/ | |
// More: http://nodejs.org/api/all.html | |
// 0. Synopsis. | |
// http://nodejs.org/api/synopsis.html |
This file contains hidden or 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
$.fn.flash = function(dur) { | |
var $el = this; | |
setTimeout(function() { | |
$el.fadeOut('slow', function() { | |
$el.remove() | |
}) | |
}, dur) | |
} | |
// example: fade out after 5 seconds |
This file contains hidden or 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
$.fn.form2JSON = function() { | |
var data = {} | |
this.serializeArray().map(function(item) { | |
data[item.name] = item.value; | |
}); | |
return data | |
} | |
// use like this | |
var data = $form.form2JSON() |
This file contains hidden or 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') | |
var tweet_image = function(status, imgUrl, done) { | |
var url = 'https://api.twitter.com/1.1/statuses/update_with_media.json' | |
var req = request.post(url, { | |
oauth: { | |
consumer_key: this.oauth.consumer_key, | |
consumer_secret: this.oauth.consumer_secret, | |
token: this.oauth.access_token, |
This file contains hidden or 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="../paper-tabs/paper-tabs.html"> | |
<link rel="import" href="../paper-tabs/paper-tab.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> | |
#core_tooltip { | |
left: 1000px; | |
top: 430px; |
This file contains hidden or 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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
This file contains hidden or 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
.fa-facebook, .fa-facebook-square { | |
color: #3b5998 | |
} | |
.fa-twitter, .fa-twitter-square { | |
color: #00aced | |
} | |
.fa-google-plus, .fa-google-plus-square { | |
color: #dd4b39 | |
} | |
.fa-youtube, .fa-youtube-play, .fa-youtube-square { |
This file contains hidden or 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
.ui-btn-text { | |
white-space: normal; | |
} |