Skip to content

Instantly share code, notes, and snippets.

View sgruhier's full-sized avatar

Sébastien Gruhier sgruhier

  • https://xilinus.com
  • Saint-Paul en Forêt
  • X @sgruhier
View GitHub Profile
@sgruhier
sgruhier / .block
Created April 23, 2017 09:58
zoom/pan d3v4
license: mit
@sgruhier
sgruhier / page_turn.dart
Last active July 5, 2022 13:20 — forked from slightfoot/page_turn.dart
Page Turn Effect - By Simon Lightfoot. Replicating this behaviour. https://www.youtube.com/watch?v=JqvtZwIJMLo
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
require "redis"
worker_processes 8
preload_app true
timeout 600
listen '/tmp/vodeclic.sock', :backlog => 1024
pid '/tmp/vodeclic.pid'
##
# REE
@sgruhier
sgruhier / Guardfile
Created September 8, 2012 14:45
Quick (and dirty) Guardfile for CoffeeScriptRedux and SourceMap
DEBUG = 1
module ::Guard
class Coffee < Guard
DEFAULT_OPTIONS = {compiler: 'coffee', input: 'coffee', output: 'js'}
def initialize(watchers = [], options = {})
watchers = [] if !watchers
defaults = DEFAULT_OPTIONS.clone
if options[:input]
@sgruhier
sgruhier / liquid.rb
Created September 21, 2011 07:06
Rails 3.1 version of extra/liquid_view.rb of liquid markup gem
class LiquidHandler
PROTECTED_ASSIGNS = %w( template_root response _session template_class action_name request_origin session template
_response url _request _cookies variables_added _flash params _headers request cookies
ignore_missing_templates flash _params logger before_filter_chain_aborted headers )
def self.call(template)
new.compile(template)
end
def compile(template)
@sgruhier
sgruhier / gist:1086231
Created July 16, 2011 10:14
override jquery UI widget method
// If you dont need to call original method
$.widget("ui.addresspicker", $.extend({}, $.ui.addresspicker.prototype, {
_updatePosition: function(){
// Do what you want to
}
}));
// If you need to call original method
var _updatePosition = $.ui.addresspicker.prototype._updatePosition;
$.widget("ui.addresspicker", $.extend({}, $.ui.addresspicker.prototype, {
# Extend jQuery objects with Underscore collection methods.
#
# Each collection method comes in two flavors: one prefixed
# with _, which yields a bare DOM element, and one prefixed
# with $, which yields a jQuery-wrapped element.
#
# So if `this` is a jQuery object, instead of:
#
# _.max @, (el) -> $(el).height()
#
@sgruhier
sgruhier / balloon.css
Created June 8, 2010 09:38
Demo page of CSS3 transform/transition with some JS
#ballon {
-webkit-transition: all .2s ease-in-out;
}
module PDoc
module Generators
module Html
CODE_BLOCK_REGEXP = /(?:\n\n|\A)(?:\s{4,}lang(?:uage)?:\s*(\w+)\s*\n)?((?:\s{4}.*\n*)+)(^\s{0,3}\S|\z)?/
attr_reader :default_language, :highlighter
class SyntaxHighlighter
def initialize(options = {})
@default_language = options[:default_language] ||= :javascript
@highlighter = options[:highlighter] ||= :none
@sgruhier
sgruhier / update_google_chrome.sh
Created June 3, 2009 20:07 — forked from joefiorini/update_google_chrome.sh
Update chromium on Mac OS X
#!/bin/bash
set -e
BUILD_URL='http://build.chromium.org/buildbot/snapshots/sub-rel-mac/'
update_google_chrome() {
get_latest_revision_number
download_latest_revision
extract_code