Skip to content

Instantly share code, notes, and snippets.

@fgrehm
fgrehm / cocoon-chosen.coffee
Created February 19, 2013 18:15
Cocoon + Chosen
jQuery ($) ->
$('.add_fields').each ->
$this = $(this)
insertionNode = $this.data('association-insertion-node')
insertionTraversal = $this.data('association-insertion-traversal')
if (insertionNode)
if (insertionTraversal)
insertionNode = $this[insertionTraversal](insertionNode)
else
@AhmedElSharkasy
AhmedElSharkasy / best_practices
Last active April 8, 2019 14:53
Rails 3 AntiPatterns, Useful snippets and Recommended Refactoring. Note: Some of them are collected from different online resources/posts/blogs with some tweaks.
Rails as it has never been before :)
Rails 3 AntiPatterns, Useful snippets and Recommended Refactoring.
Note: Some of them are collected from different online resources/posts/blogs with some tweaks.
@boriscy
boriscy / description.md
Last active March 19, 2020 19:50
Phoenix + React + Elm config with webpack

Attemp to make work react with elm on a phoenix project.

The project directory for elm is

web
├── channels
├── controllers
│   └── api
│   └── v1
@sionc
sionc / rails-postgres-backbone-bootstrap-bootswatch
Last active April 6, 2020 17:35
Instructions on creating a new app using Ruby on Rails, Postgresql, Backbone.js, Twitter Boostrap, Bootstwatch
- Check rails version
$ rails -v
- To update rails
$ gem update rails
- Creating a new rails app using postgresql
$ mkdir rails_projects
$ cd rails_projects
$ rails new myapp --database=postgresql
@nrollr
nrollr / MySQL.md
Last active October 28, 2020 02:53
Install MySQL on El Capitan using Homebrew

Install MySQL on OS X El Capitan

Normally the installation of MySQL can be achieved with a single command, which executes a script provided by MacMiniVault : bash <(curl -Ls http://git.io/eUx7rg)

However, at the time of writing the script is not compatible with OS X El Capitan (10.11)

Install MySQL using Homebrew

An alternative to the aforementioned installation script is installing MySQL using Homebrew. This gist assumes you already have Homebrew installed, if not first read the article "Homebrew and El Capitan"

Make sure Homebrew has the latest formulae, so run brew update first

React && Firebase Workshop

Contact Information

Prequisite Setup

  • A recent version of Node.js
  • npm install -g create-react-app
.
├── actions
├── stores
├── views
│   ├── Anonymous
│   │   ├── __tests__
│   │   ├── views
│   │   │   ├── Home
│   │   │   │   ├── __tests__
│   │   │   │   └── Handler.js
@dfcarpenter
dfcarpenter / dockerfile
Created April 14, 2018 21:36
django dockerfile
FROM python:3.6-stretch as python-base
COPY webpack requirements.txt package.json yarn.lock ./
RUN set -ex \
&& apt-get update \
&& apt-get install apt-transport-https \
&& apt-get update \
&& apt-get install --no-install-recommends -y \
libpq-dev curl libjpeg-dev rsync libsass-dev libicu57 zlib1g-dev libpng-dev libmagickwand-dev \

Meteor Alternatives Per Feature

This table was created in 2015 so may be quite outdated today.

Feature Meteor Solution Alternative Solutions Description
Live DB Sync [livequery][lq] ([mongo-oplog]), [ddp] RethinkDB, Redis, ShareDB, [npm:mongo-oplog], [firebase], etc. Push DB updates to client/server.
Latency Compensation, Optimistic UI [minimongo][mm] [RethinkDB][lcr], [mWater/minimongo] (fork, not ws but http, browserify) Imitate successful db query on client before it is done.
Isomorphic Code [isobuild] & isopacks browserify Write one code for server/client/mobile.
Isomorphic Packaging [isobuild], atmosphere No more separate packages for server & client. Get bower + npm + mobile.