Skip to content

Instantly share code, notes, and snippets.

View dalpo's full-sized avatar
💭
I'm still learning...

Andrea Dal Ponte dalpo

💭
I'm still learning...
View GitHub Profile
@dalpo
dalpo / cancan_link_helper.rb
Last active December 17, 2015 05:49
Cancan link Helper
@dalpo
dalpo / simple_form_bootstrap_datepicker.rb
Created May 12, 2013 13:42
Simple_form custom input for bootstrap-datepicker
module SimpleForm
module Inputs
class DatePickerInput < SimpleForm::Inputs::StringInput
def input_html_options
value = object.send(attribute_name)
options = {
value: value.nil?? nil : I18n.localize(value, format: :datepicker),
data: {
behaviour: 'datepicker'
}
@ragingwind
ragingwind / Backend Architectures Keywords and References.md
Last active February 24, 2026 02:06
Backend Architectures Keywords and References

Lesson's learnt building the Guardian

Below is a collection of my favourite responses I gathered from Guardian engineers when asked the question: What have you learnt starting from scratch and building a mobile-first next generation web platform for the Guardian?

Daithi O Crualaoich

  • Work with great people.
  • Deploy like crazy. This means the team has to control the infrastructure as well as code.
  • Design is not a service. Designers have to sit in the team.
  • Infrastructure is intrinsically unreliable. Discard and replace is the robust strategy.
  • Use your CDN for HTML too.
  • Don't always do as you are told.
@maxim
maxim / rails_load_path_tips.md
Last active January 9, 2025 00:59
How to use rails load paths, app, and lib directories.

In Rails 3

NOTE: This post now lives (and kept up to date) on my blog: http://hakunin.com/rails3-load-paths

If you add a dir directly under app/

Do nothing. All files in this dir are eager loaded in production and lazy loaded in development by default.

If you add a dir under app/something/

@dalpo
dalpo / blueimp-gallery-videojs.css.sass
Last active August 29, 2015 14:03
bluimp-gallery videojs integration
This is a Python script to extract GNOME/GTK's color scheme and apply it to Wine, so that the themes (approximately) match.
Instructions:
1. Set your Gnome theme as you would like it
2. Run with a command like "python wine_colors_from_gtk.py"
3. Restart any apps running in Wine. They should match the Gnome theme colors now.
Better description with screenshots here: http://www.endolith.com/wordpress/2008/08/03/wine-colors/
This is also stored on https://code.launchpad.net/~endolith/+junk/wine-color-scraper
@gbuesing
gbuesing / ml-ruby.md
Last active December 10, 2025 03:21
Resources for Machine Learning in Ruby

UPDATE a fork of this gist has been used as a starting point for a community-maintained "awesome" list: machine-learning-with-ruby Please look here for the most up-to-date info!

Resources for Machine Learning in Ruby

Gems

@potomak
potomak / style_guide.markdown
Created November 26, 2014 08:27
Addictive style guide

Javascript

  • Indent using 2 spaces
  • Use single quotes, unless you are writing JSON
  • Declare one variable per var statement
  • Variables and properties should use lower camel case capitalization
  • Class names should be capitalized using upper camel case
  • Constants should be declared as regular variables or static class properties, using all uppercase letters
  • Use the triple equality operator
@jimmynguyc
jimmynguyc / capistrano-puma-setup-first-time.txt
Last active October 9, 2016 10:46
Setup Capistrano Puma First Time
In Gemfile
=========
gem 'capistrano-rails'
gem 'capistrano-rbenv'
gem 'capistrano-rbenv-install'
gem 'capistrano-safe-deploy-to'
gem 'capistrano-sidekiq'
gem 'capistrano3-puma'
In Capfile