Skip to content

Instantly share code, notes, and snippets.

@cs278
cs278 / is_serialized.php
Created October 23, 2009 18:25
PHP is_serialized() function.
<?php
/**
* This program is free software. It comes without any warranty, to
* the extent permitted by applicable law. You can redistribute it
* and/or modify it under the terms of the Do What The Fuck You Want
* To Public License, Version 2, as published by Sam Hocevar. See
* http://sam.zoy.org/wtfpl/COPYING for more details.
*/
/**
@joergschiller
joergschiller / a2dp_sink_ubuntu_linux.md
Created January 24, 2012 23:05
A2DP Sink on Ubuntu Linux with bluez (streaming bluetooth stereo audio from smartphone to pc)

Howto Enable and Use A2DP Sink on Ubuntu Linux with Bluez

  1. Add Enable=Source to /etc/bluetooth/audio.conf right after [General].

  2. Find address in form XX:XX:XX:XX:XX:XX of phone with hcitool scan.

  3. Pair and trust smartphone with sudo bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX and sudo bluez-test-device trusted XX:XX:XX:XX:XX:XX yes.

  4. Create loopback in pulseaudio connection bluetooth a2dp source with alsa sink:

@jmblog
jmblog / test1.js
Created June 1, 2012 04:31
Examples of shim config in RequireJS 2.0 - Backbone and underscore
require.config({
paths: {
underscore: '../underscore-min'
},
shim: {
underscore: {
exports: function() {
return _.noConflict();
}
}
@johnantoni
johnantoni / mysql.txt
Created August 7, 2012 18:57
mysql + vagrant + remote access
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
@feldmayer
feldmayer / gist:3370310
Created August 16, 2012 13:57
Drupal 7: Load block programmatically with i18n
<?php
$block_id = 2;
$block = block_block_view($block_id);
$block['content'] = i18n_string(array('blocks', 'block', $block_id, 'body'), $block['content']);
?>
@doublerebel
doublerebel / titanium-inspector.sh
Last active October 11, 2015 07:18
How to use Node-Inspector to Debug Titanium Mobile Applications
npm install -g node-inspector
/path/to/.titanium/mobilesdk/linux/3.1.0.GA/android/builder.py simulator projectname /path/to/android-sdk-linux /path/to/project com.your.project 16 WVGA800 127.0.0.1:5858
node-inspector
@brentertz
brentertz / emitter.js
Created October 20, 2012 16:30
Node.js: Extend a class to be an EventEmitter
var util = require('util'),
EventEmitter = require('events').EventEmitter;
var Server = function() {
var self = this;
this.on('custom_event', function() {
self.logSomething('custom_event');
});
@sarg
sarg / README.md
Last active November 5, 2023 10:43
rk30xx loader image unpacker

Obtaining RK3066 boot ROM.

Here are my steps.

At first, I took a look to RK30xxLoader(L)_V1.18.bin. This file appears in update.img for my device. So, I unpacked update.img using rk29Kitchen.

strings on that file returns nothing interesting, so I assumed the file is crypted

@Su-Shee
Su-Shee / geocouchosm
Last active December 28, 2015 12:34
adding geocouch to couchdb and add osm data
1) have the couchdb source available, geocouch needs some headerfiles
2) get and unpack the appropriate branch of geocouch suited for your couchdb version -
I have 1.3.0 so I got
https://github.com/couchbase/geocouch/tree/couchdb1.3.x
3) set environment:
export COUCH_SRC=/WHEREVER/apache-couchdb-1.3.0/src/couchdb/
@mguymon
mguymon / websocket.conf
Created June 11, 2013 14:05
stunnel config for secure websockets (wss://)
key = /etc/certs/server.key
cert = /etc/certs/server.crt
CApath = /etc/ssl/certs
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
setuid = stunnel4
setgid = stunnel4
pid = /var/run/stunnel4/websocket.pid