Skip to content

Instantly share code, notes, and snippets.

View mechanicles's full-sized avatar

Santosh Wadghule mechanicles

View GitHub Profile
@mechanicles
mechanicles / Gemfile
Created June 27, 2020 08:13 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@mechanicles
mechanicles / findLocalItems.js
Created June 6, 2020 17:51 — forked from n0m4dz/findLocalItems.js
how to filter keys from localStorage with a regex
// returns an array of localStorage items in key/value pairs based on a query parameter
// returns all localStorage items if query isn't specified
// query can be a string or a RegExp object
function findLocalItems (query) {
var i, results = [];
for (i in localStorage) {
if (localStorage.hasOwnProperty(i)) {
if (i.match(query) || (!query && typeof i === 'string')) {
value = JSON.parse(localStorage.getItem(i));

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

$VERBOSE = nil
require File.expand_path('../rooby', __FILE__)
Person = Rooby::Class.new 'Person' do
define :initialize do |name|
@name = name
end
define :name do
@mechanicles
mechanicles / gist:4109221
Created November 19, 2012 06:16 — forked from jrochkind/gist:2161449
A Capistrano Rails Guide

A Capistrano Rails Guide

by Jonathan Rochkind, http://bibwild.wordpress.com

why cap?

Capistrano automates pushing out a new version of your application to a deployment location.

I've been writing and deploying Rails apps for a while, but I avoided using Capistrano until recently. I've got a pretty simple one-host deployment, and even though everyone said Capistrano was great, every time I tried to get started I just got snowed under not being able to figure out exactly what I wanted to do, and figured I wasn't having that much trouble doing it "manually".

@mechanicles
mechanicles / Menlo-ForPowerline.ttc.zip
Created August 4, 2012 15:56 — forked from sjl/Menlo-ForPowerline.ttc.zip
Patched Menlo for Powerline. This one includes the bold, italic, etc variants.
@mechanicles
mechanicles / gist:1443731
Created December 7, 2011 17:37 — forked from dhh/gist:1014971
Use concerns to keep your models manageable
# autoload concerns
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(
#{config.root}/app/controllers/concerns
#{config.root}/app/models/concerns
)
end
end
@mechanicles
mechanicles / git_tips.md
Created November 2, 2011 09:19 — forked from fguillen/git_tips.md
Git Tips

(Several of these git examples have been extracted from the book 'Pragmatic guide to GIT' of Travis Swicegood )

Git tips

Global git user

git config --global user.name "Fernando Guillen"
git config --global user.email "fguillen.mail+spam@gmail.com"

Repository git user

cd /develop/myrepo

@mechanicles
mechanicles / gist:1225067
Created September 18, 2011 13:23 — forked from anildigital/gist:1225047
Blocks aren't objects .....

"blocks aren't objects" and the corollary "blocks are objects"

blocks