Skip to content

Instantly share code, notes, and snippets.

@mauropm
mauropm / app.js
Created January 3, 2012 21:25
Image caching in Appcelerator
var win = Ti.UI.createWindow({
backgroundColor: 'white'
});
var imgTableLoco = Ti.UI.createTableView({
width: 270,
height: 290,
top: 0,
backgroundColor: 'black'
});
@kitek
kitek / gist:1579117
Created January 8, 2012 17:50
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");
/*
* Mixin properties of n objects into the given object - pass in as many objects to mix in as you like.
* Can perform a shallow or deep copy (shallow is default for performance reasons).
*
* Usage:
* mixin([Boolean deepCopy,] objectToExtend, objectToMixIn [, as many other objects as needed])
*
* Examples:
*
* var o1 = {
@narenranjit
narenranjit / VelToJSON
Created January 24, 2012 20:23
Convert objects in Velocity templates to JSON
#macro(VelListToJSON $list )
#set($myList = $list )## dereference
{
#foreach($key in $myList.keySet())
"$key":
#set($x = $myList.get($key))
#VelToJSON($x)
#if($foreachCount != $myList.keySet().size()) , #end
#end
}
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@macias
macias / CHANGELOG
Last active February 2, 2019 18:23
Coursera Getter [download video lecture]
2014-11-03 * Coursera requires just another authentication key --
`__204u`
2013-12-01 * credentials file is used instead of passing directly
"CAUTH" value
2013-09-24 * ignoring hidden lecture sections
2013-09-06 * ability to download resources by icon class
* added new flags for setting target filename as original
@tonycoco
tonycoco / image_filters.rb
Created June 11, 2012 15:04
Useful image filters (Instagram/Hipster/Cool) for CarrierWave using MiniMagick (ImageMagick)
module CarrierWave
module MiniMagick
def toaster_filter
manipulate! do |img|
img.modulate '150,80,100'
img.gamma 1.1
img.contrast
img.contrast
img.contrast
img.contrast
@beebs93
beebs93 / app.js
Created June 21, 2012 04:23
Simple example of integrating Firebase with Appcelerator
// Set master UI background color
Ti.UI.backgroundColor = '#000';
// Set vars
var winMain,
vwWebMain,
lblValue,
vwBtn;
// Set global event listener as Firebase callback
@tzmartin
tzmartin / video.thumbnail.js
Created July 10, 2012 17:46
Create Thumbnail Image From Video File, Titanium Mobile
/**
Create Thumbnail of Video File
This snippet captures a thumbnail JPG image, based on a frame @ 2 second time-lapse.
Titanium Mobile
*/
var movie = Titanium.Media.createVideoPlayer({
contentURL:FILENAME,