Skip to content

Instantly share code, notes, and snippets.

View coldnew's full-sized avatar
💭
I may be slow to respond.

Yen-Chin,Lee coldnew

💭
I may be slow to respond.
View GitHub Profile
;; use `frame-bufs.el' to mimic perspective feature
(idle-require 'frame-bufs)
(defun frame-bufs-switch-buffer ()
"Switch buffer, within buffers associated with current frame (`frame-bufs-buffer-list')"
(interactive)
(if (and (fboundp 'frame-bufs-mode)
frame-bufs-mode)
(let* ( (buffers (mapcar 'buffer-name (frame-bufs-buffer-list (selected-frame))))
# gcc-4.8
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew install openocd
openocd --version # homebrew release of openocd supports most jtag adapters (ie stlink2)
wget "https://launchpad.net/gcc-arm-embedded/4.8/4.8-2013-q4-major/+download/gcc-arm-none-eabi-4_8-2013q4-20131218-mac.tar.bz2"
cd ~/Downloads
tar -xzvf gcc-arm-none-eabi-4_8-2013q4-20131218-mac.tar.bz2
sudo cp -R gcc-arm-none-eabi-4_8-2013q4 /usr/local/
/usr/local/gcc-arm-none-eabi-4_8-2013q4/bin/arm-none-eabi-gcc --version # test
/**
* PhantomJS script to capture/render screenshots of the slides of a Reveal.js powered slideshow.
*/
var page = require('webpage').create();
var args = require('system').args;
// Get url to render from command line.
var url;
if (args.length < 2) {
From 4a3bb99fe5eecd06e77f4fedb5729466df09750f Mon Sep 17 00:00:00 2001
From: Ilya Grigorik <ilya@igvita.com>
Date: Fri, 18 May 2012 06:41:34 +0800
Subject: [PATCH] add outbound click tracking + time on slide analytics
plugins for GA
---
js/analytics/outbound-clicks.js | 102 +++++++++++++++++++++++++++++++++++++++
js/analytics/time-on-slide.js | 25 ++++++++++
js/slide-deck.js | 5 ++
angular.module('yourModule')
.directive('tabsSwipable', ['$ionicGesture', function($ionicGesture){
//
// make ionTabs swipable. leftswipe -> nextTab, rightswipe -> prevTab
// Usage: just add this as an attribute in the ionTabs tag
// <ion-tabs tabs-swipable> ... </ion-tabs>
//
return {
restrict: 'A',
require: 'ionTabs',

Install OS X 10.10 Yosemite in VirtualBox

(based on this pastebin i've found via Google, markdownified and adjusted to work with the official Yosemite release)

Yosemite's first developer preview was released right after Monday's WWDC opening keynote. For the general public, an open beta will be available to download later this summer. However, for those who want a sneak peek at the new hotness, there is a way to safely install it without risking your machine, using the free and powerful VirtualBox application from Oracle.

(LEGAL DISCLAIMER: This guide aims to explain how to create a virtual machine on a regularly purchased Apple computer, running a genuine Mac OS X operating system, for testing purposes only.)

@coldnew
coldnew / backup.sh
Last active August 29, 2015 14:20 — forked from petedoyle/backup.sh
#!/bin/bash
# Capture current date as a variable
DATE=`date +"%Y%m%d-%H:%M:%S"` # example output format: 20110925-21:10:36
echo -e "\nRecursively snapshotting storage pool with tag @BACKUP_$DATE"
echo "Running 'zfs snapshot -r storage@BACKUP_$DATE'"
time zfs snapshot -r storage@BACKUP_$DATE
echo -e "\n\nDeleting backups pool to make way for new backup (usually takes a few minutes)."
@coldnew
coldnew / repo-apply.sh
Last active August 29, 2015 14:21 — forked from gipi/repo-apply.sh
#!/bin/sh
## Script to patch up diff reated by `repo diff`
# from https://groups.google.com/d/msg/repo-discuss/43juvD1qGIQ/7maptZVcEjsJ
if [ -z "$1" ] || [ ! -e "$1" ]; then
echo "Usages: $0 <repo_diff_file>";
exit 0;
fi
rm -fr _tmp_splits*
@coldnew
coldnew / tictactoe.clj
Last active August 29, 2015 14:22 — forked from ponzao/tictactoe.clj
(defn solve
[grid]
(remove nil?
(run* [q]
(macro/symbol-macrolet [_ (lvar)]
(== q grid)
(conde
((== grid [[q _ _]
[_ q _]
[_ _ q]]))
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="author" content="Martin Bean" />
<title>Twitter&rsquo;s Bootstrap with Ryan Fait&rsquo;s Sticky Footer</title>
<link rel="stylesheet" href="css/bootstrap.min.css" />
<style>
html, body {
height: 100%;