Skip to content

Instantly share code, notes, and snippets.

View anandpdoshi's full-sized avatar

Anand Doshi anandpdoshi

View GitHub Profile
anandpdoshi /
Last active October 11, 2015 06:37
ERPNext Installer
from __future__ import unicode_literals
import os, commands, sys
def install():
# get required details
root_pwd = get_root_password()
db_name, db_pwd = get_new_db_details()
# install path
pdvyas / vm.yml
Created February 27, 2016 22:58
VM build server playbook
View vm.yml
- hosts: all
user: root
become: yes
become_user: root
- name: Set hostname
hostname: name={{ hostname }}
- name: install packages
neo22s / formatcurrency.php
Created March 18, 2014 14:41
NumberFormatter formatCurrency alternative
View formatcurrency.php
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
ini_set('display_errors', 1);
function formatcurrency($floatcurr, $curr = 'USD')
* A list of the ISO 4217 currency codes with symbol,format and symbol order
nolanlawson /
Last active July 26, 2022 08:02
Promises puzzle cheat sheet
zulhfreelancer /
Last active December 4, 2023 21:17
How to use a local Ruby gem in Rails project?


You are working on a Rails app that uses a gem named abc. This gem is hosted on RubyGems and the source code of the gem is available at

You created a new branch locally for your gem (new-feature). You wanted to modify the gem and load it directly to your local Rails app. And, you don't want to push the gem changes to GitHub and publish the gem to RubyGems just yet.

You want all the changes that you made in your local gem directory get reflected immediately in your local Rails app without requiring you to run gem build and gem install command in the gem's local directory.


dergachev /
Last active February 12, 2024 17:18
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF


To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

dypsilon /
Last active February 16, 2024 06:20
A badass list of frontend development resources I collected over time.
robcowie /
Created February 7, 2011 16:05
Memory-efficient, streaming query generator with MySQLdb
from MySQLdb.cursors import SSDictCursor
def iterate_query(query, connection, arraysize=1):
c = connection.cursor(cursorclass=SSDictCursor)
while True:
nextrows = c.fetchmany(arraysize)
if not nextrows: