Skip to content

Instantly share code, notes, and snippets.

View dariocravero's full-sized avatar

Darío Javier Cravero dariocravero

View GitHub Profile
@dariocravero
dariocravero / LICENSE
Created January 5, 2012 16:56
Schedule commands using "at" from ruby.
# Copyright (c) 2012 - Darío Javier Cravero
#
# 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:
@rmetzler
rmetzler / app.rb
Created January 22, 2012 12:51 — forked from jamiehodge/app.rb
Sinatra API for resumable.js
require 'sinatra'
require 'slim'
require 'coffee-script'
require 'sass'
require 'sequel'
DB = Sequel.sqlite
DB.create_table :uploads do
String :id, text: true, primary_key: true
@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 {})
@bgentry
bgentry / sequel_paranoia.rb
Created November 30, 2011 03:20
Sequel Paranoia plugin (i.e. acts_as_paranoid)
module Sequel
module Plugins
# The paranoia plugin creates hooks that automatically set deleted
# timestamp fields. The field name used is configurable, and you
# can also set whether to overwrite existing deleted timestamps (false
# by default). Adapted from Timestamps plugin.
#
# Usage:
#
# # Soft deletion for all model instances using +deleted_at+
@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
@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?
@dariocravero
dariocravero / panels-and-pagesfaq.md
Created May 24, 2016 20:51
An FAQ on Panels and Pages

Panels and Pages FAQ

1) What is Pages?

It's a collaborative tool to allow teams of developers and designers to move extremely fast from concept to real applications that work on the web and on Android and iOS.

It takes a JSON and outputs React code.

Designers and developers work together on the JSON code.

@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]
}
}
#!/bin/sh
opts=""
while true; do
if [ -f .prettieropts ]; then
opts=$(cat .prettieropts)
break
fi