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 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
$.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
$.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
// 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
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
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
convert icon.png -resize 180x180 "./icons/180.png" | |
convert icon.png -resize 29x29 "./icons/29.png" | |
convert icon.png -resize 58x58 "./icons/29-2x.png" | |
convert icon.png -resize 87x87 "./icons/29-3x.png" | |
convert icon.png -resize 40x40 "./icons/40.png" | |
convert icon.png -resize 80x80 "./icons/40-2x.png" | |
convert icon.png -resize 50x50 "./icons/50.png" | |
convert icon.png -resize 100x100 "./icons/50-2x.png" | |
convert icon.png -resize 57x57 "./icons/57.png" | |
convert icon.png -resize 114x114 "./icons/57-2x.png" |
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
const mongoose = require('mongoose') | |
const childSchema = mongoose.Schema({ | |
name: String | |
}, { | |
strict: 'throw' | |
}) | |
const parentSchema = mongoose.Schema({ | |
children: [childSchema] |
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
function run(input, parameters) { | |
var app = Application('System Events'); | |
app.includeStandardAdditions = true; | |
app.processes.byName('NotificationCenter').windows.buttons[0].click(); | |
return input; | |
} |