Skip to content

Instantly share code, notes, and snippets.

View fanweixiao's full-sized avatar
🦖
hacking on @yomorun

C.C. fanweixiao

🦖
hacking on @yomorun
View GitHub Profile
@Diegus83
Diegus83 / Mac OS X Lion installer.txt
Last active February 9, 2024 14:16
Makes one Bootable USB Lion installer from Apple's provided PKG (2021)
# This is not intended to be guide, I just wrote it as a reminder to myself of the steps necessary.
# If you find it useful, that's great, but keep in mind the paths and device ID's will need
# to be adjusted to your case. And you may need sudo if you are not doing this while booted from recovery like I did.
Get the InstallMacOSX.dmg from https://support.apple.com/kb/DL2077?locale=en_US
Mount the image
hdiutil mount InstallMacOSX.dmg
cd /Volumes/Install\ Mac\ OS\ X

How to install dlib v19.9 or newer (w/ python bindings) from github on macOS and Ubuntu

Pre-reqs:

  • Have Python 3 installed. On macOS, this could be installed from homebrew or even via standard Python 3.6 downloaded installer from https://www.python.org/download. On Linux, just use your package manager.
  • On macOS:
    • Install XCode from the Mac App Store (or install the XCode command line utils).
    • Have homebrew installed
  • On Linux:
@dmvaldman
dmvaldman / promisesEM.md
Last active June 1, 2024 00:20
Promises as EventEmitters

Promises as EventEmitters

I was trying to understand JavaScript Promises by using various libraries (bluebird, when, Q) and other async approaches.

I read the spec, some blog posts, and looked through some code. I learned how to

@MartinSeeler
MartinSeeler / konami-cheatcode-rx.js
Created October 2, 2015 10:39
Konami Cheat-Code with RxJs
var cheatCode = [38,38,40,40,37,39,37,39,66,65]; // Konami Cheat Code
Rx.Observable
.fromEvent(document, 'keydown')
.map(function(x) { return x.keyCode; })
.windowWithCount(cheatCode.length, 1)
.flatMap(function(xs) { return xs.toArray(); })
.do(function (x) { console.log(x); })
.filter(function(xs) { return _.isEqual(cheatCode, xs); })
.subscribe(function(x) { console.log('CHEATER!!11elf'); });
@elrrrrrrr
elrrrrrrr / gulpfile.js
Created September 25, 2014 13:23
css sprites
var gulp = require('gulp');
var gulpif = require('gulp-if');
var sprite = require('css-sprite').stream;
var base = require('gulp-base64');
// generate sprite.png and _sprite.scss
gulp.task('sprites', function () {
return gulp.src('img/*.png')
.pipe(sprite({
name: 'tx.png',
@laser
laser / streams.js
Last active March 27, 2018 00:30
Socket.IO + Bacon.js
var request = require('request-json'),
express = require('express'),
app = express(),
http = require('http').Server(app),
io = require('socket.io'),
Bacon = require('baconjs').Bacon,
client = request.newClient('http://localhost:3000/api/'),
db = require('mongodb').MongoClient;
///////////////////////////////////////////////////////////
git remote add --track master upstream git://github.com/upstreamname/projectname.git
@andrew8088
andrew8088 / test.sh
Created January 11, 2012 02:53
This little script is an example script combining JSDev with running the script in the terminal via node.
#! /bin/sh
d=$(date)
jsdev <test.js >test.dev.js code equal:areEqual -comment "Development Version" -comment "Built: $d"
node test.dev.js
@fanweixiao
fanweixiao / cpojer.zsh-theme
Created November 24, 2011 22:59 — forked from cpojer/cpojer.zsh-theme
My zsh theme
# ZSH Theme by @cpojer
PROMPT='[%{$fg[red]%}%n%{$fg[black]%}: %{$fg[blue]%}%~%{$reset_color%}\
$(git_prompt_info)\
%{$fg[black]%}%(!.#.]$)%{$reset_color%} '
PROMPT2=''
RPS1=''
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[green]%} %{$fg[yellow]%}("
ZSH_THEME_GIT_PROMPT_SUFFIX=")%{$reset_color%}"
@brentertz
brentertz / rvm2rbenv.txt
Created November 21, 2011 23:00
Switch from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
# Ensure your homebrew is working properly and up to date
brew doctor
brew update
## Install ###################################################################