Skip to content

Instantly share code, notes, and snippets.

View can3p's full-sized avatar

Dmitrii Petrov can3p

View GitHub Profile
@can3p
can3p / restart_bluetooth.sh
Created March 17, 2016 08:38 — forked from nicolasembleton/restart_bluetooth.sh
Restart Bluetooth Daemon on Mac OS X without restarting
#!/bin/bash
sudo kextunload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
sudo kextload -b com.apple.iokit.BroadcomBluetoothHostControllerUSBTransport
var pipeline = require('when/pipeline')
, callbacks = require('when/callbacks');
var mockMakeAjaxRequestAndReturnCallback = callbacks.lift(require('mockMakeAjaxRequestAndReturnCallback'));
var mockRenderData = require('mockRenderData');
var generateLink = function (domain) {
return 'http://' + domain + '/resource';
};
@can3p
can3p / pr.md
Created March 25, 2013 20:58 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@can3p
can3p / node_debian_init.sh
Created August 27, 2011 17:42 — forked from peterhost/node_debian_init.sh
Daemon init script for node.js based app/server (DEBIAN/UBUNTU)
#! /bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28