Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

denisinla

:octocat:
View GitHub Profile
View gist:9796027
/*
* 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 Aug 29, 2015
Retina image replacement
View jquery.js
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 Nov 12, 2010
Base deploy recipe set.
View deploy.rb
#
# 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 Mar 15, 2011
RubyGems Ubuntu Install
View rubygems.sh
#!/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 Sep 30, 2015
Digital Ocean(Ubuntu) - New Rails4 App deploy with Capistrano3, Unicorn, Nginx and MySQL
View DO_Unicorn.md
@alicial
alicial / recent-tumblr-posts.js
Created Aug 5, 2012
How to Display Recent Posts in Tumblr
View recent-tumblr-posts.js
$(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 Oct 17, 2012
Ruby gems and Ubuntu
View rubygems-on-ubuntu.md
  • 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 Oct 27, 2012
Helper Function for tweeting with twurl
View tweet.sh
# 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 Nov 27, 2012
Lightweight jQuery character counter plugin.
View jquery.counter.js
(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 Nov 29, 2012
Chef and Vagrant setup to easily create databases as needed
View Vagrantfile
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 = {