Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<title></title>
</head>
<body>
<button id="startButton">Start</button>
<video id="remoteView" height="300" width="300" autoplay></video>
@zachallaun
zachallaun / git-questions.md
Last active December 24, 2015 14:49
A series of questions that someone might ask if they wanted to learn more about git.

A bit beyond git basics: Q&A edition

Questions:

  • How do I create a new branch?
  • How do I switch to another branch?
  • How do I create and switch to a new branch in a single command?
  • I've made whatever changes I want on my new branch. How do I merge these changes back into master?
  • After merging, git told me that I made a "fast-forward merge." What does that mean?
  • After merging, git told me that there were auto-merge conflicts. What does that mean and how do I fix it?
@FokkeZB
FokkeZB / shell
Last active October 30, 2017 18:39
Get the Key Hash for Titanium's develoment keystore (replace 3.1.3.GA with your version), required for the Facebook SDK (https://developers.facebook.com/docs/android/getting-started/facebook-sdk-for-android) and the SHA1 fingerprint for the Google Cloud API's (pw: tirocks).
keytool -exportcert -alias androiddebugkey -keystore ~/Library/Application Support/Titanium/mobilesdk/osx/3.1.3.GA/android/dev_keystore | openssl sha1 -binary | openssl base64
keytool -exportcert -alias androiddebugkey -keystore ~/Library/Application\ Support/Titanium/mobilesdk/osx/3.1.3.GA/android/dev_keystore -list -v
@tieleman
tieleman / blur_worker.js
Last active January 11, 2017 23:10
A web worker to blur image data from a canvas. Pass it a message with a data object supplying ImageData, a radius and quality (number of passes). Returns a message with the resulting blurred ImageData.
/*
* BoxBlurFilter
* Visit http://createjs.com/ for documentation, updates and examples.
*
* Adapted by Hiro to function as a standalone web worker. Pass it a
* message with a data object supplying ImageData, a radius and quality
* (number of passes). Returns a message with the resulting
* blurred ImageData.
*
*
<!DOCTYPE>
<html>
<head>
<title>Dissecting Gmail's Email Attachments - Dropping Files</title>
<style>
.msg {
display: none
}
.dragging .msg {
@stevenou
stevenou / GeolocationModule.mm
Created February 14, 2012 21:15
Geofencing in Titanium
// this file located in /Library/Application Support/Titanium/mobilesdk/osx/{version_number}
// add the following methods to GeolocationModule.mm
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
{
NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:NUMBOOL(YES),@"success",[NSDictionary dictionaryWithObjectsAndKeys:NUMDOUBLE(region.center.latitude),@"lat",NUMDOUBLE(region.center.longitude),@"lng",NUMDOUBLE(region.radius),@"radius",region.identifier,@"identifier",nil],@"region",nil];
if ([self _hasListeners:@"enteredRegion"])
{
[self fireEvent:@"enteredRegion" withObject:event];
@jpurcell
jpurcell / pull-to-refresh(android).js
Created April 5, 2011 15:58
Tweetie-like pull to refresh and pull to load more. Note that it requries set heights for everything.
// This is the Android version of the Tweetie-like pull to refresh table:
// http://developer.appcelerator.com/blog/2010/05/how-to-create-a-tweetie-like-pull-to-refresh-table.html
var win = Ti.UI.currentWindow;
var alertDialog = Titanium.UI.createAlertDialog({
title: 'System Message',
buttonNames: ['OK']
});
var scrollView = Ti.UI.createScrollView({
@netzpirat
netzpirat / 0_README.md
Created November 12, 2010 10:42
Continuous CoffeeScript testing with Guard and Jasmine

Continuous CoffeeScript testing with Guard and Jasmine

This Gist shows how to set up a Rails project to practice BDD with CoffeeScript, Guard and Jasmine. You can see this setup in action on Vimeo

  • Install Gems with Bundler with bundle install
  • Define your guards with mate Guardfile
  • Initialize Jasmine with bundle exec jasmine init
  • Configure Jasmine with mate spec/support/yasmine.ym
  • Start Guard with bundle exec guard