Skip to content

Instantly share code, notes, and snippets.

View shanlalit's full-sized avatar

Lalit Shandilya shanlalit

View GitHub Profile
@jamesdwilson
jamesdwilson / meteor-create.sh
Last active December 20, 2015 13:09
Create Meteor project using meteor create, set up directory structure following the Unofficial Meteor FAQ (by oortcloud). Also initializes git and uses coffescript instead of JS. Note: I am using main.html instead of index.html as I think that is better as it loads last. To make this your default skeleton, empty your ~/.meteor/tools/latest/tools…
#!/bin/sh
# Follows https://github.com/oortcloud/unofficial-meteor-faq#where-should-i-put-my-files
# I release this into the Public domain -osirisx11 on freenode
: <<'END'
osiris@krypton:~/playpen$ ~/meteor-create.sh example
example: created.
To run your new app:
cd example
meteor
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2025 08:16
A badass list of frontend development resources I collected over time.
@yury
yury / application.css.scss
Last active December 17, 2015 19:39
Example of tiny, smalll and large column and shortcuts for bootstrap 3.0.x grid
// Grid shortcuts
// use with https://github.com/anjlab/bootstrap-rails
//
// Columns for phones
// - columns: .x[1-12]
// For small devices (tablets and small desktops)
// - columns: .s[1-12]
// - offsets: .so[0-11]
// - pushes: .sr[0-11]
// - pulls: .sl[0-11]
<% provide :title, 'Consumer Profile | Update' %>
<legend>Update your Profile</legend>
<%= simple_form_for @consumer, :html => { :class => 'cons_edit form-horizontal' } do |f| %>
<%= f.input :display_name, :label => "Public name", :placeholder => @consumer.user.username %>
<%= f.input :tagline, :placeholder => "Your tagline" %>
#!/usr/bin/tclsh8.5
#
# Usage: git-unmerged branch1 branch2
#
# Shows all the non-common commits in the two branches, where non-common
# commits means simply commits with a unique commit *message*.
proc getlog branch {
lrange [split [exec git log $branch --oneline] "\n"] 0 400
}
@coldnebo
coldnebo / rails_trace.rb
Last active August 15, 2024 15:15
This Rack middleware for Rails3 lets you see a call-trace of the lines of ruby code in your application invoked during a single request. Only code within your app is considered (i.e. in the /app folder). This expands on my previous attempt (https://gist.github.com/3077744). Example of output in comments below.
require 'singleton'
# outputs a colored call-trace graph to the Rails logger of the lines of ruby code
# invoked during a single request.
#
# Example:
#
# 1) Make sure this file is loaded in an initializer
#
# 2) Add the following to your application.rb in Rails3:
@huangjs
huangjs / gist:4273403
Created December 13, 2012 01:54
Example code for using FullContact influencer notification in iced-coffee-script on node.js.
# This is example code for influencer notification using FullContact on node.js
# Programming language used here is iced-coffee-script
# Author: Maptia
# License: public domain
_ = require 'underscore'
iced = require('iced-coffee-script').iced
request = require 'request'
fullContactAPIKey = '<your-fullcontact-api-key>'
@mislav
mislav / geoip_service.rb
Created September 3, 2012 11:48
Simple GeoIP service class using freegeoip.net and Faraday
require 'faraday_middleware'
require 'hashie/mash'
# Public: GeoIP service using freegeoip.net
#
# See https://github.com/fiorix/freegeoip#readme
#
# Examples
#
# res = GeoipService.new.call '173.194.64.19'
@mislav
mislav / initialize_spellcheck.rb
Created August 18, 2012 15:32
Raise error if "initialize" method name is misspelled
# Public: Implementation of "Strike a match" algorithm for calculating
# similarity between strings.
#
# http://www.catalysoft.com/articles/StrikeAMatch.html
#
# Examples
#
# checker = StringSimilarityChecker.new('Quick brown fox')
#
# checker =~ 'quick brown ox' #=> true
@jch
jch / yard-mount.rb
Created July 2, 2012 18:17
mount yard documentation at /docs
# 1) Running a raw RackAdapter in config.ru mounted at '/' works fine
require 'bundler/setup'
require 'yard'
run YARD::Server::RackAdapter.new(
{'surfiki' => [YARD::Server::LibraryVersion.new('surfiki', nil, File.expand_path('../.yardoc', __FILE__))]},
{
:single_library => true,
:caching => false
})