Skip to content

Instantly share code, notes, and snippets.

@zerocity
zerocity / gist:4082088
Created November 15, 2012 22:53
update nested entries
{
name:"some name",
dob:"april 4, 1985",
content:
0:{children:
0:{
'title':'some text',
1:{etc ..}
}
1:{children:
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
@zerocity
zerocity / template
Last active August 29, 2015 13:59
Neurocid json template
{
"BattleFieldLayout": {
"width": 300000,
"height": 300000,
"iterations": 1500
},
"PhysicsLayout": {
"gravity": [
0,
0
@zerocity
zerocity / app.js
Created May 1, 2014 10:33
ui-router // scope problem
...
.state('app',{
url: '/',
controller: 'MainCtrl as main',
views:{
'header':{
controller: 'MainCtrl as main',
templateUrl:'views/header.html'
},
#!/bin/sh
CONFIG_FILE=$(echo /etc/X11/xorg.conf.d/??-touchpad-cmt.conf)
test -f $CONFIG_FILE || CONFIG_FILE="/etc/X11/xorg.conf.d/40-touchpad-cmt.conf"
# Check which type of touchpad is present.
if grep -qi synaptics /proc/bus/input/devices; then
echo "Synaptics touchpad detected."
TOUCHPAD="synaptics"
elif grep -qi alps /proc/bus/input/devices; then
<nav id="startpage-search"><form method="GET" action="http://alpha.wallhaven.cc/search" accept-charset="UTF-8" id="search"><fieldset class="oneline"><div><input type="search" id="search-text" name="q" placeholder="Search..." autofocus="autofocus"></div><button class="icon-button"><i class="fa fa-search"></i></button></fieldset></form></nav>
import Phaser from 'phaser';
class Spinner extends Phaser.Group {
constructor(game, x,y){
super(game,undefined,'TESTER');
let scale = 0.3;
let buttonHeight = 64 * scale;
let padding = 10;
this.value = 0
this.btOne = new Phaser.Button(game,x,y, 'plus',this.plus, this);
@zerocity
zerocity / post-merge
Created May 2, 2017 13:21 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@zerocity
zerocity / vscode
Created August 7, 2017 06:22
my vscode
a
@zerocity
zerocity / AppRouter.js
Created September 25, 2017 09:51
AppRouter
import React, { Component } from "react";
import generated from "./generated";
import { StackNavigator } from "react-navigation";
import { generateNavStack, generateHeader } from './utils';
import { Toc } from './components';
const router = {
Application: {
screen: (props) => (<Toc {...props} generated={generated} />),
navigationOptions : generateHeader("Table of Content")