-
Add to
.gitignore
:node_modules public
-
Add to your app
dependencies
ofpackage.json
:
/* x is the <input/> element | |
type is the type you want to change it to. | |
jQuery is required and assumed to be the "$" variable */ | |
function changeType(x, type) { | |
if(x.prop('type') == type) | |
return x; //That was easy. | |
try { | |
return x.prop('type', type); //Stupid IE security will not allow this | |
} catch(e) { | |
//Try re-creating the element (yep... this sucks) |
Add to .gitignore
:
node_modules
public
Add to your app dependencies
of package.json
:
$VERBOSE = nil | |
require File.expand_path('../rooby', __FILE__) | |
Person = Rooby::Class.new 'Person' do | |
define :initialize do |name| | |
@name = name | |
end | |
define :name do |
<?php | |
$remoteFile = file_get_contents('ssh2.sftp://user:[email protected]:22/path/to/file'); | |
// See http://php.net/manual/en/wrappers.ssh2.php for more informations. |
sealed trait KeyValueStore[+A] { | |
def map[B](f: A => B): KeyValueStore[B] = | |
this match { | |
case Put(k, v, q) => Put(k, v, f compose q) | |
case Get(k, q) => Get(k, f compose q) | |
case Del(k, q) => Del(k, f compose q) | |
} | |
} | |
case class Put[A](k: String, v: String, q: Option[String] => A) extends KeyValueStore[A] | |
case class Get[A](k: String, q: Option[String] => A) extends KeyValueStore[A] |
package com.snapchat.android.util; | |
import javax.crypto.Cipher; | |
import javax.crypto.spec.SecretKeySpec; | |
public class AESEncrypt | |
{ | |
public static String ENCRYPT_KEY = "1234567891123456"; | |
public static String ENCRYPT_KEY_2 = "M02cnQ51Ji97vwT4"; |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
function bufferBytes(buffer) { | |
return [].map.call(new Uint8Array(buffer), function(x) {return x}) | |
} | |
function nanBytes(nan) { | |
var a = new Float64Array(1); | |
a[0] = nan; | |
return bufferBytes(a.buffer); | |
} |