Skip to content

Instantly share code, notes, and snippets.

View denisinla's full-sized avatar
👋

denisinla

👋
View GitHub Profile
anonymous
anonymous / gist:9796027
Created March 26, 2014 23:22
/*
* grunt-cli
* http://gruntjs.com/
*
* Copyright (c) 2012 Tyler Kellen, contributors
* Licensed under the MIT license.
* https://github.com/gruntjs/grunt-init/blob/master/LICENSE-MIT
*/
'use strict';
@jonsuh
jonsuh / jquery.js
Last active August 29, 2015 14:03
Retina image replacement
var $images = $("img[data-1x]");
if (window.devicePixelRatio == 2) {
$.each($images, function() {
var $this = $(this);
$this.attr("src", $this.data("2x"));
});
} else {
$.each($images, function() {
@kurbmedia
kurbmedia / deploy.rb
Created November 12, 2010 06:11
Base deploy recipe set.
#
# This is a default deploy.rb
# it is included into the Rails 3 Basic Template by default.
#
require 'active_support'
require 'lib/deploy_helpers'
DEPLOY_CONFIG = YAML::load(File.open("#{Rails.root}/config/deploy.yml"))
@vongrippen
vongrippen / rubygems.sh
Created March 15, 2011 20:04
RubyGems Ubuntu Install
#!/bin/bash
sudo apt-get install ruby-full
wget http://production.cf.rubygems.org/rubygems/rubygems-1.6.2.tgz -O /tmp/gems
tar -xzvf /tmp/gems -C /tmp
cd /tmp/rubygems-1.6.2
sudo ruby ./setup.rb
sudo dpkg-divert --rename --add /usr/bin/gem
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo gem update --system
@adriendumont
adriendumont / DO_Unicorn.md
Last active September 30, 2015 05:45
Digital Ocean(Ubuntu) - New Rails4 App deploy with Capistrano3, Unicorn, Nginx and MySQL
@alicial
alicial / recent-tumblr-posts.js
Created August 5, 2012 17:03
How to Display Recent Posts in Tumblr
$(function() {
var url = '/rss';
var $list = $('#recent-posts');
$.ajax({
url: url,
type: 'GET',
dataType: 'xml',
success: function(data) {
var $items = $(data).find('item');
$items.each( function() {
@remi
remi / rubygems-on-ubuntu.md
Created October 17, 2012 21:25
Ruby gems and Ubuntu
  • rmagick: sudo apt-get install imagemagick libmagick9-dev
  • mysql, mysql2: sudo apt-get install libmysqlclient-dev
  • coffee-script: sudo apt-get install nodejs && sudo ln -s /usr/bin/nodejs /usr/local/bin/node
  • thinking-sphinx: sudo apt-get install sphinxsearch
  • nokogiri: sudo apt-get install libxslt-dev libxml2-dev
  • curb: sudo apt-get install libcurl4-openssl-dev
  • sqlite3: sudo apt-get install libsqlite3-ruby libsqlite3-dev
@jtallant
jtallant / tweet.sh
Created October 27, 2012 20:25
Helper Function for tweeting with twurl
# Helper function for tweeting via twurl
# You must have the twurl Ruby gem installed and configured https://github.com/marcel/twurl
# This function goes in your bash profile
# Usage: tweet "This is a command line tweet"
function tweet {
twurl -q -d "status=$1" /1/statuses/update.xml
}
@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 = {