Skip to content

Instantly share code, notes, and snippets.

@hatpick
hatpick / saver.coffee
Created November 27, 2012 02:39 — forked from josephg/saver.coffee
Script to automatically re-save a sharejs document as its edited.
# This script watches for changes in a document and constantly resaves a file
# with the document's contents.
#
# Usage: coffee saver.coffee -d <DOCNAME> [--url http://somehost:8000/sjs] [-f filename]
client = require('share').client
fs = require('fs')
argv = require('optimist')
.usage('Usage: $0 -d docname [--url URL] [-f filename]')
@hatpick
hatpick / glass.html
Created June 26, 2014 02:36
[wearscript] sphero
<html style="width:100%; height:100%; overflow:hidden">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type='text/javascript' src='https://cdn.firebase.com/js/client/1.0.15/firebase.js'></script>
</head>
<body style="width:100%; height:100%;text-align:center; overflow:hidden; margin:0" bgcolor="#000">
<img style="height:360px;display:block;" src="http://orbotix.wpengine.netdna-cdn.com/wp-content/uploads/sphero-logo-vertical-blue-reg.jpg">
<script>
var fb = new Firebase("https://sphero.firebaseio.com/");
function server() {
@hatpick
hatpick / sample.java
Last active September 11, 2015 00:01
Sinch Call
private Call call;
private class SinchCallClientListener implements CallClientListener {
@Override
public void onIncomingCall(CallClient callClient, Call incomingCall) {
call = incomingCall;
final AlertDialogPro.Builder callReceive = new AlertDialogPro.Builder(ChatActivity.this);
LayoutInflater factory = LayoutInflater.from(ChatActivity.this);
final View innerView = factory.inflate(R.layout.incoming_call, null);
Button accBtn = (Button) innerView.findViewById(R.id.accept_voip_call);
@hatpick
hatpick / Decrypter.java
Created July 13, 2016 02:36 — forked from scotttam/Decrypter.java
encrypt and decrypt with PBKDF2/SHA1 and AES
import javax.crypto.Cipher;
import java.security.spec.KeySpec;
import javax.crypto.spec.PBEKeySpec;
import javax.crypto.SecretKey;
import javax.crypto.spec.SecretKeySpec;
import javax.crypto.SecretKeyFactory;
import java.security.AlgorithmParameters;
import javax.crypto.spec.IvParameterSpec;
public class Decrypter {
@hatpick
hatpick / react-native-material-kit.d.ts
Last active August 31, 2017 12:36
React Native Material Kit
declare module 'react-native-material-kit' {
import * as React from 'React';
import {
ViewProperties,
ViewStyle,
TextStyle,
KeyboardType,
TextInputProperties,
TouchableWithoutFeedbackProperties
} from 'react-native';