Skip to content

Instantly share code, notes, and snippets.

@eikes
eikes / .block
Last active Jul 2, 2020 — forked from mbostock/.block
South up map
View .block
license: gpl-3.0
View tomt.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eikes
eikes / gist:5a64b661022c756bd6522ed94770e2a6
Created Jul 4, 2016
List of Ruby on Rails Timezone names and their alias
View gist:5a64b661022c756bd6522ed94770e2a6
["Africa/Algiers", "West Central Africa"],
["Africa/Cairo", "Cairo"],
["Africa/Casablanca", "Casablanca"],
["Africa/Harare", "Harare"],
["Africa/Johannesburg", "Pretoria"],
["Africa/Monrovia", "Monrovia"],
["Africa/Nairobi", "Nairobi"],
["America/Argentina/Buenos_Aires", "Buenos Aires"],
["America/Bogota", "Bogota"],
["America/Caracas", "Caracas"],
@eikes
eikes / run_phoenix_on_ubuntu.sh
Created Dec 29, 2015
run phoenix on ubuntu
View run_phoenix_on_ubuntu.sh
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
sudo apt-get install git esl-erlang elixir postgresql nodejs nodejs-legacy npm
sudo npm -g install brunch@1
mix local.hex
mix archive.install https://github.com/phoenixframework/phoenix/releases/download/v1.1.1/phoenix_new-1.1.1.ez
git clone https://github.com/eikes/phoenix_guides_server.git
@eikes
eikes / run phoenix on amazon linux.sh
Created Dec 28, 2015
run phoenix on amazon linux
View run phoenix on amazon linux.sh
# app deps
sudo yum install git
# erlang deps
sudo yum groupinstall "Development Tools"
sudo yum install ncurses-devel
# erlang
wget http://www.erlang.org/download/otp_src_18.1.tar.gz
tar -zxvf otp_src_18.1.tar.gz
@eikes
eikes / .__mini_rails__
Last active Aug 29, 2015
Single file rails app
View .__mini_rails__
__mini_rails__
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<h1>Hello, world!</h1>
View CaseInsensitiveStringFilter.php
<?php
namespace Liip\AcmeBundle\Filter;
use Sonata\AdminBundle\Form\Type\Filter\ChoiceType;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Sonata\DoctrineORMAdminBundle\Filter\StringFilter;
class CaseInsensitiveStringFilter extends StringFilter
{
@eikes
eikes / jquery.uncheckable_radio.js
Created Mar 11, 2014
jQuery plugin to allow unchecking radio buttons
View jquery.uncheckable_radio.js
(function ($) {
$.fn.uncheckableRadio = function () {
return this.each(function () {
var radio = this,
label = $('label[for="' + radio.id + '"]');
if (label.length === 0) {
label = $(radio).closest("label");
}
var label_radio = label.add(radio);
label_radio.mousedown(function () {
View collection_widget.twig
{% block collection_widget %}
{% spaceless %}
<div class="collection">
{% if prototype is defined %}
{% set attr = attr|merge({'data-prototype': block('collection_item_widget') }) %}
{% endif %}
<div {{ block('widget_container_attributes') }}>
{{ form_errors(form) }}
<ul>
{% for prototype in form %}
You can’t perform that action at this time.