Skip to content

Instantly share code, notes, and snippets.

View anandpdoshi's full-sized avatar

Anand Doshi anandpdoshi

View GitHub Profile
@anandpdoshi
anandpdoshi / install_erpnext.py
Last active October 11, 2015 06:37
ERPNext Installer
View install_erpnext.py
#!/usr/bin/python
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
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
tasks:
- name: Set hostname
hostname: name={{ hostname }}
- name: install packages
@neo22s
neo22s / formatcurrency.php
Created March 18, 2014 14:41
NumberFormatter formatCurrency alternative
View formatcurrency.php
<?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
nolanlawson / promises_answer_sheet.md
Last active July 26, 2022 08:02
Promises puzzle cheat sheet
View promises_answer_sheet.md
@zulhfreelancer
zulhfreelancer / local-ruby-gem.md
Last active December 4, 2023 21:17
How to use a local Ruby gem in Rails project?
View local-ruby-gem.md

Situation

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 https://github.com/your-username/abc.

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.

Steps

@dergachev
dergachev / GIF-Screencast-OSX.md
Last active February 12, 2024 17:18
OS X Screencast to animated GIF
View GIF-Screencast-OSX.md

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

Instructions

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

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