Skip to content

Instantly share code, notes, and snippets.

#include <Wire.h> // This library allows you to communicate with I2C
#include <Adafruit_GFX.h> // Adafruit GFX graphics core library
#include <Adafruit_SSD1306.h> // Driver library for 'monochrome' 128x64 and 128x32 OLEDs
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
@windix
windix / rubyconf_au_2017.md
Last active February 13, 2017 23:54
RubyConf AU 2017
#!/bin/bash
## Copyright (C) 2009 Przemyslaw Pawelczyk <[email protected]>
## License: GNU General Public License v2, v3
#
# Lockable script boilerplate
### HEADER ###
LOCKFILE="/var/lock/`basename $0`"
https://andi34.github.io/
http://android.stackexchange.com/questions/62985/how-do-i-install-cyanogenmod-11-on-a-samsung-galaxy-tab-2-gt-p5113/62986#62986
http://forum.xda-developers.com/showthread.php?t=2571498
http://forum.xda-developers.com/showthread.php?t=2676180
Current version: 4.2.2
@windix
windix / note.md
Last active May 1, 2019 20:25
Raspberry PI 3 Setup

My Default Packages

  • vim
  • byobu
  • aria2

Version Information

Software Information

RACK_ENV=production bundle exec sidekiq -r ./bootstrap.rb -C ./config/sidekiq.yml
rvmsudo rvm get stable
rvmsudo rvm install 2.0.0
<?php
// debug log full
function _dbg_logf() {
$args = func_get_args();
_dbg_log_core(true, $args);
}
// debug log standard
function _dbg_log() {
<?php
function change_value_1(array $o) {
$o['b'] = 5;
}
function change_value_2(array $o) {
$o = array();
$o['b'] = 5;
}
wfeng@mbp  ~  which hg
/usr/local/share/python/hg
Mercurial.configure do |conf|
conf.hg_binary_path = "/usr/local/share/python/hg"
end
repo = Mercurial::Repository.open("/Users/wfeng/work_local/www/betslip")
repo.branches.active.collect { |b| { :name => b.name, :hash_id => b.hash_id, :selected => ["HEAD", "default"].include?(b.name) } }
@windix
windix / gist:6075388
Last active December 20, 2015 04:59
timestamp handling example for PHP and javascript
<?php
$now = time();
?>
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript">
// we will add our javascript code here