Skip to content

Instantly share code, notes, and snippets.

View pigoz's full-sized avatar
:octocat:

Stefano Pigozzi pigoz

:octocat:
View GitHub Profile
@jjgod
jjgod / osx-video-decoding-efficiency.markdown
Last active August 29, 2015 13:57
CPU consumption numbers for current video players on OS X
@ChrisK2
ChrisK2 / README.md
Last active August 29, 2015 14:07
ytdl_hook.lua

youtube-dl hook script for mpv

Now part of mpv

As of 079ecd7 (2014-11-19), the hook script is now integrated into mpv and will be avaiblable when compiled with LUA support. It is (currently) disabled by default, to enable it add --ytdl=yes to your command-line or ytdl=yes to your mpv.conf.

Open Issues

@jicksta
jicksta / gist:1001736
Created June 1, 2011 03:19
Jasmine shared behavior for asserting that a certain event on an element exposed as a Backbone view property properly executes the expected view instance method
function assertViewAction(viewClass, eventCallbackName, elementAccessorName, eventName, viewReference) {
it("should run the " + eventCallbackName + " action when the " + elementAccessorName + " gets a " + eventName + " event (assertViewAction)", function() {
var isPrototypal = eventCallbackName in viewClass.prototype;
if (isPrototypal) {
spyOn(viewClass.prototype, eventCallbackName);
}
var view = viewReference();
if (!isPrototypal) {
spyOn(view, eventCallbackName);
}
-> % vagrant status
/home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/driver/virtualbox.rb:26:in `initialize': wrong number of arguments (0 for 1) (ArgumentError)
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/vm.rb:136:in `new'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/vm.rb:136:in `rescue in reload!'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/vm.rb:128:in `reload!'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/vm.rb:35:in `initialize'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/environment.rb:430:in `new'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/environment.rb:430:in `block in load_vms!'
from /home/tyler/.rvm/gems/ruby-1.9.3-p0@infra-puppet/gems/vagrant-1.0.0/lib/vagrant/environme
@sowawa
sowawa / sinachiku.rb
Created June 18, 2012 07:00 — forked from mattn/sinachiku.rb
sinatra on mruby
require 'HTTP'
require 'UV'
module Sinachiku
@routes = { 'GET' => [], 'POST' => [] }
def self.route(method, path, opts, &block)
@routes[method] << [path, opts, block]
end
def self.do(r)
@routes[r.method].each {|path|
@morgoth
morgoth / layout_filter.rb
Created July 10, 2012 18:29
Layout filter for rake-pipeline
# Support for rendering views in layout
# Example usage in Assetfile:
#
# match "views/*.md" do
# markdown
# layout path: "app/views/layout.erb"
# concat { |input| input.sub(%r{views/}, "").sub(/\.md/, ".html") }
# end
require "rake-pipeline"
@BrianGenisio
BrianGenisio / gist:6299303
Last active December 21, 2015 11:29
The default behavior is to reject the error. If you don't do that, you are hiding the error condition.
angular.module('httpProgress')
.factory('httpProgressInterceptor', function($q) {
var requestCount = 0;
function updateProgress(update) {
var previous = requestCount;
requestCount += update;
if(previous <= 0 && requestCount > 0) {
NProgress.start();
@fenbox
fenbox / gulpfile.js
Created December 29, 2013 11:48
sample gulp config: gulpfile.js
// Include gulp
var gulp = require('gulp');
// Include Our Plugins
var sass = require('gulp-sass');
var lr = require('tiny-lr'),
refresh = require('gulp-livereload'),
server = lr();
@jiayihu
jiayihu / action-lifecycle.middleware.ts
Created March 9, 2017 14:32
Allow subscription, as Promise, to redux-saga and redux-observable POJO actions
import { Middleware } from 'redux';
export interface IActionLifecycle {
resolveType: string;
rejectType: string;
}
/**
* Middleware which allows to chain async actions as Promises.
* @see https://github.com/redux-observable/redux-observable/issues/90
@lox
lox / Makefile
Last active March 28, 2018 12:55
Replaced Grunt/Gulp with a Makefile
SASSC = sass --style compact
COMPSDIR = resources/assets/components
SASSDIR = resources/assets/css
JSDIR = resources/assets/js
DISTDIR = web/dist
CSSDIR = $(DISTDIR)/css
SASSINC = $(SASSDIR) \
$(COMPSDIR)/asimov/src/scss \
$(COMPSDIR)/asimov-contests/src/scss \
$(COMPSDIR)/asimovicons/src/scss