Skip to content

Instantly share code, notes, and snippets.

View linmic's full-sized avatar

Linmic linmic

View GitHub Profile
import React, { Component } from 'react';
import styles from './theme-light.css';
import withStyles from '../../../decorators/with-styles';
@withStyles(styles)
class ThemeLight extends Component {
render() {
return null;
}
}
import React, { Component } from 'react';
import styles from './theme-dark.css';
import withStyles from '../../../decorators/with-styles';
@withStyles(styles)
class ThemeDark extends Component {
render() {
return null;
}
}
'use strict';
import React, { PropTypes, Component } from 'react';
import ThemeLight from './theme-light';
import ThemeDark from './theme-dark';
class ThemeManager extends Component {
static propTypes = {
theme: PropTypes.string.isRequired,
@linmic
linmic / VREffect.js
Last active August 29, 2015 14:19
VREffect.js
/*
original author: dmarcos / https://github.com/dmarcos
tweaked by @linmic / https://github.com/linmic
latest update: 2014/04/16
mainly updated the api calls of HMD to make it works on the latest devices e.g. Oculus Rift DK2
*/
THREE.VREffect = function ( renderer, done ) {
var cameraLeft = new THREE.PerspectiveCamera();
#!/bin/sh
# credit: https://github.com/creationix/nvm/issues/400#issuecomment-49511425 by mzgol
set -e
cd ~/.nvm
git fetch --tags
TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Checking out tag $TAG..."
@linmic
linmic / index.js
Created December 23, 2014 06:39
requirebin sketch
'use strict'
var React = require('react');
var FdItem = React.createClass({
render: function() {
return React.createElement('form', null, 'test');
}
});

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
gulp = require('gulp');
lr = require('gulp-livereload');
gulp.task('watch', function() {
lr.listen()
dest = ["app/views/**","app/assets/**"];
gulp.watch(dest).on('change', function(file) {
lr.changed(file.path);
});
});
var opt = {
type: 'list',
title: 'keep burning',
message: 'Primary message to display',
priority: 1,
items: [{ title: '', message: ''}],
iconUrl:'../images/icon.png'
};
chrome.notifications.create('notify1', opt, function(id) { console.log("Last error:", chrome.runtime.lastError); });
@linmic
linmic / bluetooth.js
Last active August 29, 2015 14:06 — forked from revolunet/bluetooth.js
/*
Chrome Packaged app Bluetooth API test
Before interacting with a BT device, you need to :
1) get the device MAC and service UUID with startDiscovery and getServices methods
2) request permission with chrome.permissions.request
3) add the service profile with chrome.bluetooth.addProfile (a profile is only {uuid:'xxxxxxx...'})
*/
// onConnection callback
chrome.bluetooth.onConnection.addListener(