Skip to content

Instantly share code, notes, and snippets.

View denisinla's full-sized avatar
👋

denisinla

👋
View GitHub Profile
@abitdodgy
abitdodgy / jquery.counter.js
Created November 27, 2012 16:37
Lightweight jQuery character counter plugin.
(function ($) {
// Author: Mohamad El-Husseini, www.mohamad.im
// Light weight character counter for jQuery.
// Example: http://jsfiddle.net/yHPg7/6/
"use strict";
$.fn.counter = function (options) {
options = $.extend($.fn.counter.defaults, options);
@iturgeon
iturgeon / Vagrantfile
Created November 29, 2012 19:45
Chef and Vagrant setup to easily create databases as needed
Vagrant::Config.run do |config|
config.vm.box = "lucid32"
config.vm.box_url = "http://files.vagrantup.com/lucid32.box"
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "cookbooks"
# pass json_attribs to chef
chef.json = {
@datagrok
datagrok / git-branch-simplify.md
Last active April 16, 2024 17:26
How to simplify the graph produced by git log --graph

Ideas for improvements to git log --graph

I will maybe someday get around to dusting off my C and making these changes myself unless someone else does it first.

Make the graph for --topo-order less wiggly

Imagine a long-running development branch periodically merges from master. The git log --graph --all --topo-order is not as simple as it could be, as of git version 1.7.10.4.

It doesn't seem like a big deal in this example, but when you're trying to follow the history trails in ASCII and you've got several different branches displayed at once, it gets difficult quickly.

@webgio
webgio / app.coffee
Last active December 10, 2023 10:24
Marionette.js module to manage authentication. Needs a server method that checks credentials returning true or false. Started from this blog post code: http://clintberry.com/2012/backbone-js-apps-authentication-tutorial/
App = new Marionette.Application();
App.addRegions {
"headerRegion": "#header"
"topMenuRegion": "#top-menu"
"mainRegion" : "#main"
}
App.on 'initialize:after', ->
Backbone.history.start()
@shtirlic
shtirlic / gist:5052306
Last active November 18, 2021 17:58 — forked from joelmoss/gist:2470666
set :stage, 'production'
set :shared_children, shared_children << 'tmp/sockets'
puma_sock = "unix://#{shared_path}/sockets/puma.sock"
puma_control = "unix://#{shared_path}/sockets/pumactl.sock"
puma_state = "#{shared_path}/sockets/puma.state"
puma_log = "#{shared_path}/log/puma-#{stage}.log"
namespace :deploy do
desc "Start the application"
@ElliotChong
ElliotChong / outbound-link-tracking.html
Last active December 15, 2015 18:58
Adding Outbound Link Tracking With Google Analytics
@aphexddb
aphexddb / Rails API Design.md
Last active December 17, 2015 19:58
Creating a flexible, modern API in Rails 3

This is a guide to creating a basic API in Rails for consumption by Ember.js or your favorite framework. Key areas are support of CORS requests and Jbuilder for creating a self-documenting API.

Add these gems to your Gemfile

gem 'rack-cors', :require => 'rack/cors'

gem 'jbuilder'

@JamesDullaghan
JamesDullaghan / digitalocean.md
Created July 6, 2013 20:54
Deploy rails app to digitalocean with nginx, unicorn, capistrano & postgres

Deploy Rails app to digitalocean with nginx, unicorn, capistrano & postgres

Create droplet of your liking (ubuntu 12.10 x32)

ssh to root in terminal with your server ip

ssh root@123.123.123.123

Add ssh fingerprint and enter password provided in email

@ismyrnow
ismyrnow / google-analytics-amd.js
Last active March 14, 2022 21:32
Google Analytics AMD Module
define(function (require) {
var module;
// Setup temporary Google Analytics objects.
window.GoogleAnalyticsObject = "ga";
window.ga = function () { (window.ga.q = window.ga.q || []).push(arguments); };
window.ga.l = 1 * new Date();
// Immediately add a pageview event to the queue.
@porjo
porjo / docker_LAMP.md
Last active November 21, 2019 09:54
Minimal Centos 6.4 LAMP stack running on Docker (Ubuntu 13.04 host). End result is running httpd and port 80 is forwarded through from host to container.

Installation

sudo apt-get update
sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
sudo apt-get install linux-image-extra-`uname -r`
sudo sh -c "curl http://get.docker.io/gpg | apt-key add -"
sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
sudo apt-get update
sudo apt-get install lxc-docker