Skip to content

Instantly share code, notes, and snippets.

View karellm's full-sized avatar
🌴
On vacation

Karel Ledru karellm

🌴
On vacation
View GitHub Profile
@karellm
karellm / gemfile
Created December 26, 2011 17:36
Gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'rack'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'compass', ">= 0.12.alpha.0"
gem 'compass-susy-plugin', "0.9", :require => 'susy'
@karellm
karellm / fast_gettext.rb
Created December 26, 2011 17:50
Fast Gettext initializer
# config/initializers/fast_gettext.rb
FastGettext.add_text_domain 'app', :path => 'locale'
FastGettext.default_available_locales = ['en', 'fr']
FastGettext.default_text_domain = 'app'
@karellm
karellm / README
Created November 7, 2012 23:41
Meta box definition
The first is my definition. As you can note, there is a 'templates' argument. The problem was there before I added this.
I added what I changed to the inc/classes/meta-box.php to make the metabox definition check for the template used. It is very useful to have metabox on some pages only.
@karellm
karellm / gist:6651723
Last active December 23, 2015 14:49
Meteor Dockerfile
FROM ubuntu
RUN apt-get install -y openssl vim tmux git-core curl
RUN apt-get install -y python-software-properties python
RUN add-apt-repository ppa:chris-lea/node.js
RUN echo "deb http://us.archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade
RUN apt-get install -y nodejs
RUN curl https://install.meteor.com | /bin/sh -x
@karellm
karellm / start.sh
Last active December 24, 2015 11:09
Wordpress bootstrap script
#!/bin/bash
# 1/ HERE I WANT MY WP-CONFIG.PHP TO BE OVERWRITTEN IF IT EXISTS,
# SO I CHANGED THE TEST FOR THE PWD FILE
if [ ! -f /mysql-root-pw.txt ]; then
#let's create a user to ssh into
SSH_USERPASS=`pwgen -c -n -1 8`
mkdir /home/user
useradd -G sudo -d /home/user user
<form accept-charset="UTF-8" action="/companies/12" class="l-inline" data-remote="true" method="post" novalidate="novalidate">
<div class="fields">
<div class="row">
<!-- Here goes the input -->
</div>
</div>
</form>
= form_for(@visualization) do |f|
= f.input :title
= f.fields_for :inputs_visualizations do |iv|
= iv.input :color
= iv.fields_for :input do |i|
= i.input :title
# DOCKER
# ======
if hash docker 2>/dev/null; then
alias dk="docker"
fi
dsa () {
docker stop $(docker ps -a -q)
}
@karellm
karellm / The truth.js
Created March 5, 2016 21:46
The only right way!
gulp.task(
'build-jsx',
() => {
return (
browserify({
entries: './client/index.js',
debug: true,
})
.transform(babelify.configure({
presets: ['es2015', 'react']
@karellm
karellm / adapters.application.js
Last active February 8, 2017 20:47
Relationships
import Adapter from "ember-data/adapters/json-api";
export default Adapter.extend();