Skip to content

Instantly share code, notes, and snippets.

View dariocravero's full-sized avatar

Darío Javier Cravero dariocravero

View GitHub Profile
@ngauthier
ngauthier / README.md
Created February 14, 2012 16:50
333% Test Speedup

333% Test Speedup

  1. Normal Rails setup: 30 seconds for rake test
  2. Using 1.9.3-falcon: 22 seconds
  3. Using merged task w/ db reset: 16 seconds
  4. Using merged task w/o db reset: 12 seconds
  5. Using raw ruby execution: 9 seconds

You can run rake test:fast:db to get a merged run that resets your db. However, if you have clean tests that don't pollute the db between runs, you can just run rake test:fast and it will omit db:reset. This means your sequence numbers (under PostgreSQL, at least) may keep increasing, but if you tests against those I have other words for you.

# saves are queued on a per-model-instance (aka "cid") basis...
Backbone.Model.prototype.saveWithoutQueue = Backbone.Model.prototype.save
Backbone.Model.prototype.save = (key, value, options) ->
if _.isObject(key) or not key? # flip 'em
options = value
value = null
options = (if options then _.clone(options) else {})
@CaptainN
CaptainN / jquery.mobile.just-touch.js
Created March 29, 2012 20:06
Just touch events for jQuery
// This is a combination of two modified files from jQuery Mobile,
// jquery.mobile.vmouse.js and jquery.mobile.event.js
// They were modified to only provide the touch event shortcuts, and
// avoid the rest of the jQuery Mobile framework.
// The normal jQuery Mobile license applies. http://jquery.org/license
//
// This plugin is an experiment for abstracting away the touch and mouse
// events so that developers don't have to worry about which method of input
// the device their document is loaded on supports.
//
@dariocravero
dariocravero / README.md
Created October 20, 2012 05:25
Save files in Meteor

Create a Meteor app and put the client_/server_ files in a client/server directories. Also, create a public dir to save the uploaded files.

@ngauthier
ngauthier / download-modern-ie-linux.sh
Created February 1, 2013 16:54
download all modern.ie images for linux + virtualbox
#!/bin/bash
wget -c http://virtualization.modern.ie/vhd/IEKitV1_Final/VirtualBox/Linux/{IE6_WinXP,IE7_Vista,IE8_Win7,IE9_Win7,IE10_Win8}.zip
@willurd
willurd / web-servers.md
Last active June 7, 2024 03:53
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@wikimatze
wikimatze / gist:6332795
Last active December 21, 2015 16:19
Bring padrino to the next level

I recently had the pleasure to meet Darío at eurucamp 2013 in wonderful Berlin to discuss issues with the further development of Padrino. Here are the following points we need to think over.

Handling Mailing List

As recently posted on our mailing list with the sql problem, we have problems with some posted activities which are not shown up on the page. Apparently, we I can't find the post anymore which mentioned this issue.

Questions needs to be answered:

  • Who is responsible to admin the presence (checking options, help new members with registration)
  • Should all main contributors have access to the settings?
@jfromaniello
jfromaniello / gist:8418116
Last active September 19, 2023 23:38
Example of authenticating websockets with JWTs.
var WebSocketServer = require('ws').Server;
var wss = new WebSocketServer({port: 8080});
var jwt = require('jsonwebtoken');
/**
The way I like to work with 'ws' is to convert everything to an event if possible.
**/
function toEvent (message) {
try {
@nolanlawson
nolanlawson / wishlist.md
Last active May 3, 2021 11:51
Safari IndexedDB/WebSQL bug wishlist

Safari IndexedDB/WebSQL bug wishlist

Big overview of what's missing in Safari 7.1+ and iOS 8+ in terms of browser storage.

Updated May 25th 2016

Safari (general)

@mattmccray
mattmccray / component-with-mixins.js
Created February 17, 2015 19:42
ES6 Classes w/Mixins -- Idea -- React 0.13
export function ComponentWithMixins( ...mixins) {
class MixedComponent extends React.Component { }
for( let mixin of mixins) {
// TODO: Would need to handle mixin collisions...
for( let name of Object.keys( mixin)) {
MixedComponent.prototype[ name]= mixin[ name]
}
}