Skip to content

Instantly share code, notes, and snippets.

View jahan-paisley's full-sized avatar
🌠
Working on lovely stuff

Jahan Zinedine jahan-paisley

🌠
Working on lovely stuff
View GitHub Profile
@nissoh
nissoh / ng-grid-rtl.js
Last active January 4, 2016 11:09
ng-grid rtl
/***********************************************
* ng-grid JavaScript Library
* Authors: https://github.com/angular-ui/ng-grid/blob/master/README.md
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
* Compiled At: 07/06/2013 13:50
***********************************************/
(function(window, $) {
'use strict';
// the # of rows we want to add to the top and bottom of the rendered grid rows
var EXCESS_ROWS = 6;
@umegaya
umegaya / gist:8131387
Last active January 9, 2022 12:46
about celluloid (ruby)
## celluloid?
- ruby library for concurrent programming
- https://github.com/celluloid/celluloid
## how it seems to be executed?
- include Celluloid module to your class
- instance of such a class is unit of concurrently executing.
- any method call through instance.async.method_call is queued as message and executed by
- fiber
- thread

Ruby Infrastructure Engineer, San Francisco, California

Hi, I'm Ben. I'm the lead engineer of the infrastructure team at Zendesk.

I'm looking for a passionate and talented ruby engineer to join our infrastructure team in San Francisco. Who are we? We are the hackers behind the scenes -- we build the services and struts that the rest of Zendesk builds good product on top of. We like solving hard problems, fixing deep bugs, and doing it at scale. We'll try out new technologies, but love technology that delivers on its promises. We feel confident when we press the enter key. We're a team of good generalists who like learning the stack well enough to be considered a specialist.

Some of what we've been up to recently.

@axeda
axeda / HttpBuilderTimeouts.groovy
Last active June 28, 2022 19:08
Connection Timeouts with HttpBuilder
import groovyx.net.http.HTTPBuilder
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
int TENSECONDS = 10*1000;
int THIRTYSECONDS = 30*1000;
HTTPBuilder builder = new HTTPBuilder('http://www.axeda.com')
//HTTPBuilder has no direct methods to add timeouts. We have to add them to the HttpParams of the underlying HttpClient
@ychubachi
ychubachi / rails32init.md
Last active December 11, 2015 15:28 — forked from samnang/rails31init.md
Rails 3.2 with Haml, Simple Form, Bootstrap, Rspec, Cucumber, Factory Girl, Database Cleaner, Spork, and Guard

Install Rails 3.2.11 and Bundler (2013-01-24)

gem install rails bundler

Generate new app, skipping Test::Unit file generation

rails new my_app -T --skip-bundle

Set up Gemfile

@jonmaim
jonmaim / qs.js
Created December 8, 2012 10:51
Generate query string for angular.js
/* Converts an object into a key/value par with an optional prefix. Used for converting objects to a query string */
var qs = function(obj, prefix){
var str = [];
for (var p in obj) {
var k = prefix ? prefix + "[" + p + "]" : p,
v = obj[k];
str.push(angular.isObject(v) ? qs(v, k) : (k) + "=" + encodeURIComponent(v));
}
return str.join("&");
}
@subelsky
subelsky / casperjs_example.js
Created August 8, 2012 18:51
Webscraping with CasperJS, PhantomJS, jQuery, and XPath
var system = require('system');
if (system.args.length < 5) {
console.info("You need to pass in account name, username, password, and path to casperJS as arguments to this code.");
phantom.exit();
}
var account = system.args[1];
var username = system.args[2];
var password = system.args[3];
upstream myapp {
server unix:///myapp/tmp/puma.sock;
}
server {
listen 80;
server_name myapp.com;
# ~2 seconds is often enough for most folks to parse HTML/CSS and
# retrieve needed images/icons/frames, connections are cheap in
@kristenhazard
kristenhazard / routes.rb
Created May 2, 2012 19:59
Configuring rack-offline
Kitfox::Application.routes.draw do
offline = Rails::Offline.configure :cache_interval => 30 do
cache_buster_timestamp = "20120429"
files = Dir[
"#{root}/**/*.html",
"#{root}/stylesheets/**/*.css",
"#{root}/javascripts/**/*.js",
"#{root}/images/**/*.*"]
files.each do |file|
@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)