Skip to content

Instantly share code, notes, and snippets.

contra contra

Block or report user

Report or block contra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@contra
contra / InstaxProtocol.java
Created Jul 7, 2015
Instax SP-1 Android Source
View InstaxProtocol.java
package com.Instax.sdk;
import java.io.*;
import java.util.*;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.Color;
import android.util.Log;
import com.Instax.sdk.InstaxStatus.ErrCode;
View gist:de3c0ea120437d8207ca
const os = require('os');
const fs = require('fs');
const path = require('path');
const execFile = require('child_process').execFile;
const tmpfile = path.join(os.tmpdir(), process.versions.v8+'.flags.json');
const exclusions = ['--help'];
module.exports = function (cb) {
fs.exists(tmpfile, function (exists) {
View flux.css
html {
filter: brightness(0.8) sepia(0.9);
-o-filter: brightness(0.8) sepia(0.9);
-ms-filter: brightness(0.8) sepia(0.9);
-moz-filter: brightness(0.8) sepia(0.9);
-webkit-filter: brightness(0.8) sepia(0.9);
-salesforce-filter: brightness(0.8) sepia(0.9);
-dropbox-filter: brightness(0.8) sepia(0.9);
-blink-filter: brightness(0.8) sepia(0.9);
@contra
contra / LazyLoad.js
Created Dec 2, 2014
lazy loading react components, useful for video/audio/etc
View LazyLoad.js
var React = require('react');
var events = require('add-event-listener');
var isVisible = require('../isVisible');
var LazyLoad = React.createClass({
displayName: 'LazyLoad',
propTypes: {
distance: React.PropTypes.number,
component: React.PropTypes.node.isRequired,
children: React.PropTypes.node.isRequired
View event-loop-lag.js
var last = Date.now();
var lag = 0;
setInterval(function(){
lag = Date.now() - last;
last = Date.now();
}, 0);
View react-pure-component.js
var Timer = React.createClass({
displayName: 'Timer',
propTypes: {
interval: React.PropTypes.number,
onTick: React.PropTypes.func
},
getDefaultProps: function() {
return {
interval: 1000
};
@contra
contra / after.js
Last active Aug 29, 2015
use pipelines with gulp
View after.js
var buffer = require('vinyl-buffer');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var uglify = require('gulp-uglify');
gulp.task('index', function(){
var bundler = browserify('newstimeline/livescript/index.ls');
bundler.transform('browserify-livescript');
return bundler.bundle({insertGlobals: true})
View gogoinflight.md

Stealing WiFi

/etc/hosts

This will let you access any google owned site. This includes: youtube, google cache, google translate, google search, gmail, google news, etc.

  • Install the HTTPS Everywhere extension
  • Add these rules to your /etc/hosts file
View cross-browser-filter.css
.blur {
/* modern stuff */
-webkit-filter: blur(radius);
-moz-filter: blur(radius);
-o-filter: blur(radius);
-ms-filter: blur(radius);
filter: blur(radius);
/* gecko */
filter: url(blur.svg#blur);
View bash_profile
alias fucking=sudo
alias "npm-update"="rm -rf node_modules && npm install"
alias "update-everything"="nave usemain stable && sudo npm update -g && brew update && brew upgrade"
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\[\033[33;1m\]\w\[\033[m\] (\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)) \$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
function parse_git_dirty {
You can’t perform that action at this time.