Skip to content

Instantly share code, notes, and snippets.

View avesus's full-sized avatar
🎯
Focusing

Brian Cannard avesus

🎯
Focusing
View GitHub Profile
@avesus
avesus / flux.txt
Created August 26, 2015 12:06
What Flux really is
The Dispatcher is singleton visible for all Views with its dispatch() method.
(Note: it visible for Stores with its register() method).
View uses The Dispatcher to call its dispatch() method specifying eventName and eventItemData
Store:
Domain A
Store A : EventEmitter
Collection Model A1
Tree Model A2
@avesus
avesus / git-subtles.md
Last active August 27, 2015 19:25
Git Subtles

Adding remotes

git remote add local_remote_name https://github.com/user/repo.git
git remote -v

Refresh data:

git fetch base_remote_name
@avesus
avesus / node-gc-memuse.js
Created August 28, 2015 15:21
Node gc memoryUsage test
console.log(process.memoryUsage());
global.gc();
var a = {
m: new Uint8Array(100000000)
};
var b = {
m: new Uint8Array(100000000)
};
@avesus
avesus / gist:7d66e837c1cf52c68f49
Created September 26, 2014 11:52
Yii migration cache disable
public function up()
{
$this->addColumn('post', 'alias', 'varchar(255) NOT NULL');
Yii::app()->cache->flush();
Yii::app()->db->schema->getTables();
Yii::app()->db->schema->refresh();
foreach (Post::model()->findAll() as $post) {
$post->save();
(def a ["qwe",
"asd"
"zxc",
"rty"])
(def b ["qwe"
"asd",
"zxc"
"rty"])
XTerm*Background: #3465A4
XTerm*Foreground: #EEEEEC
XTerm*font: 7x13
XTerm*faceName: Terminus:size=10:antialias=false
XTerm*saveLines: 16000
XTerm*HiForeColor: #EEEEEC
XTerm*HiBackColor: #3465A4
XTerm*geometry: +35+120
!tango color scheme
xterm*faceName: Terminus:size=10:antialias=false
xterm*font: 7x13
xterm*inputMethod:ibus
xterm*termName: xterm-256color
xterm*utf8: 1
xterm*locale: true
xterm*utf8Title: true
xterm*renderFont: true
!tango color scheme
# PLEASE READ THE MAN PAGE BEFORE EDITING THIS FILE!
# http://opensource.conformal.com/cgi-bin/man-cgi?spectrwm
# colors for focussed and unfocussed window borders
# NOTE: all colors in this file are in hex! see XQueryColor for examples
# color_focus = red
# color_unfocus = rgb:88/88/88
# bar settings
bar_enabled = 1
How to convert a CVImageBufferRef to an OpenGL texture
outputImageProviderFromTextureWithPixelFormat:pixelsWide:pixelsHigh:name:flipped:releaseCallback:releaseContext:colorSpace:shouldColorMatch
CVImageBufferRef imageBuffer = CVBufferRetain(mCurrentImageBuffer);
GLuint texture = CVOpenGLTextureGetName(imageBuffer);
id provider= [context outputImageProviderFromTextureWithPixelFormat:QCPlugInPixelFormatARGB8
pixelsWide:CVPixelBufferGetWidth(imageBuffer)
push = (element) -> (stack) ->
newStack = [element].concat stack
{value: element, stack: newStack}
pop = (stack) ->
element = stack[0]
newStack = stack.slice 1
{value: element, stack: newStack}
bind = (stackOperation, continuation) -> (stack) ->