Skip to content

Instantly share code, notes, and snippets.

View docstun's full-sized avatar

Manuel Boy docstun

View GitHub Profile
<!doctype html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="https://cdn.mxpnl.com/libs/mixpanel-platform/css/reset.css">
<link rel="stylesheet" type="text/css" href="https://cdn.mxpnl.com/libs/mixpanel-platform/build/mixpanel-platform.v0.latest.min.css">
<script src="https://cdn.mxpnl.com/libs/mixpanel-platform/build/mixpanel-platform.v0.latest.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script>
<style>
.node circle {
@eric1234
eric1234 / README.md
Last active April 9, 2021 02:09
Generate non-digest versions of asset files for Rails 4 (similar to the way Rails 3 worked)

Purpose

Restores the generation of non-digest assets from Rails 3. This is essential for when those assets must be referenced outside of Rails. Maybe some of your app in in another language, or maybe some of your JavaScript is dynamically and conditionally loaded.

Usage

Compile your assets with the regular task:

@mamarx
mamarx / PhraseTranslator.php
Created July 3, 2012 08:18
Integrate phrase into Symfony2
<?php
namespace Acme\YourBundle\Translation;
use Symfony\Bundle\FrameworkBundle\Translation\Translator as BaseTranslator;
class PhraseTranslator extends BaseTranslator
{
public function trans($id, array $parameters = array(), $domain = 'messages', $locale = null)
{
@bkutil
bkutil / deploy.rb
Created December 4, 2011 22:22 — forked from andruby/deploy.rb
Start and Stop tasks for resque workers and resque scheduler with capistrano deploy hook (without God)
after "deploy:symlink", "deploy:restart_workers"
after "deploy:restart_workers", "deploy:restart_scheduler"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')
@andruby
andruby / deploy.rb
Created January 26, 2011 19:48
Start and Stop tasks for resque workers, with capistrano deploy hook (without God)
after "deploy:symlink", "deploy:restart_workers"
##
# Rake helper task.
# http://pastie.org/255489
# http://geminstallthat.wordpress.com/2008/01/27/rake-tasks-through-capistrano/
# http://ananelson.com/said/on/2007/12/30/remote-rake-tasks-with-capistrano/
def run_remote_rake(rake_cmd)
rake_args = ENV['RAKE_ARGS'].to_s.split(',')
cmd = "cd #{fetch(:latest_release)} && #{fetch(:rake, "rake")} RAILS_ENV=#{fetch(:rails_env, "production")} #{rake_cmd}"
@jpmckinney
jpmckinney / utc_offset_to_friendly_identifier.rb
Created January 5, 2011 05:18
Changes from UTC offset to time zone identifier in Rails
# blog post: http://blog.slashpoundbang.com/post/2605632137/changing-from-utc-offset-to-time-zone-identifier-in
identifier = {
-11 => 'Samoa',#International Date Line West, Midway Island
-10 => 'Hawaii',
-9 => 'Alaska',
-8 => 'Pacific Time (US & Canada)',#Tijuana
-7 => 'Mountain Time (US & Canada)',#Arizona, Chihuahua, Mazatlan
-6 => 'Central Time (US & Canada)',#Central America, Guadalajara, Mexico City, Monterrey, Saskatchewan
-5 => 'Eastern Time (US & Canada)',#Bogota, Indiana (East), Lima, Quito