Skip to content

Instantly share code, notes, and snippets.

View adrianobarroso's full-sized avatar

Adriano Rob adrianobarroso

  • Brazil
View GitHub Profile
@barronh
barronh / earthjsonfromwrf.py
Last active April 25, 2024 00:11
Creates a json in the format required by earth[1] from Weather Research and Forecasting (WRF) outputs.
from __future__ import print_function, unicode_literals
import os
import json
import numpy as np
from netCDF4 import Dataset
import argparse
from argparse import RawDescriptionHelpFormatter
@NealJMD
NealJMD / liquid_i18n.rb
Last active September 20, 2022 14:41
Rails I18n in Liquid templating, including interpolated values. Spec can be found at https://gist.github.com/NealJMD/16cf509164bb71215a87
# The <tt>LiquidI18nRails</tt> module allows us to use the +translate+
# method of Rails' I18n library within liquid templates. To use it,
# simply pass the name of the text entry to the +t+ filter:
#
# {{ 'fundraiser.thank_you' | t }}
#
# The above tag is equivalent to calling:
#
# I18n.t('fundraiser.thank_you')
#
@balvig
balvig / active_admin.js
Last active August 23, 2020 14:22
Active Admin Cloudinary
# app / assets / javascripts / active_admin.js
//= require active_admin/base
//= require jquery.ui.widget
//= require jquery.iframe-transport
//= require jquery.fileupload
//= require cloudinary/jquery.cloudinary
//= require attachinary
//= require attachments
@biow0lf
biow0lf / gist:1486342
Created December 16, 2011 14:53
liquid + i18n from rails
# lib/liquid_i18n_rails.rb
module LiquidI18nRails
def t(string)
I18n.t(string.to_sym)
end
end
# config/initializers/liquid.rb
require 'liquid_i18n_rails'
Liquid::Template.register_filter LiquidI18nRails