Skip to content

Instantly share code, notes, and snippets.

var mongoose = require('mongoose');
mongoose.connect('mongo://localhost/test');
var conn = mongoose.connection;
var users = conn.collection('users');
var channels = conn.collection('channels');
var articles = conn.collection('articles');
var insertUsers = Q.nfbind(users.insert.bind(users));
var insertChannels = Q.nfbind(channels.insert.bind(channels));
@raiscui
raiscui / dabblet.css
Created June 6, 2014 04:05
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f0f0f2;
/*background: linear-gradient(45deg, #f06, yellow);*/
min-height: 100%;
@raiscui
raiscui / dabblet.css
Created June 6, 2014 04:06
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f0f0f2;
/*background: linear-gradient(45deg, #f06, yellow);*/
min-height: 100%;
@raiscui
raiscui / dabblet.css
Created June 6, 2014 04:06
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f0f0f2;
/*background: linear-gradient(45deg, #f06, yellow);*/
min-height: 100%;
@raiscui
raiscui / dabblet.css
Created June 6, 2014 04:29
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: transparent;
/*background: linear-gradient(45deg, #f06, yellow);*/
#cloud-config
---
users:
- name: core
passwd: $1$8Kxo5IMS$dGqEN0MlLgLELsQ/NpBHp/
coreos-ssh-import-github: raiscui
groups:
- sudo
- docker
coreos:
@raiscui
raiscui / Enhance.js
Created December 23, 2015 12:45 — forked from sebmarkbage/Enhance.js
Higher-order Components
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
@raiscui
raiscui / install_ffmpeg_ubuntu.sh
Created July 6, 2016 13:08 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
echo “<request><mode>1</mode></request>” | curl -X POST -H “__RequestVerificationToken:1099746139” -H “Content-type: text/xml” -d @- http://192.168.8.1/api/device/mode
@raiscui
raiscui / pi2.js
Created January 25, 2017 07:26
pi2 接收
var Gpio = require('pigpio').Gpio,
led = new Gpio(17, { mode: Gpio.OUTPUT }),
led2 = new Gpio(18, { mode: Gpio.OUTPUT });
led.pwmFrequency(50)
led2.pwmFrequency(50)
led.pwmWrite(0);
const PWRUN = 110;
const PWSTOP = 90;
led2.pwmWrite(PWSTOP);