Skip to content

Instantly share code, notes, and snippets.

View anandpdoshi's full-sized avatar

Anand Doshi anandpdoshi

View GitHub Profile
@zulhfreelancer
zulhfreelancer / local-ruby-gem.md
Last active December 4, 2023 21:17
How to use a local Ruby gem in Rails project?

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

@pdvyas
pdvyas / vm.yml
Created February 27, 2016 22:58
VM build server playbook
---
- hosts: all
user: root
become: yes
become_user: root
tasks:
- name: Set hostname
hostname: name={{ hostname }}
- name: install packages
@nolanlawson
nolanlawson / promises_answer_sheet.md
Last active July 26, 2022 08:02
Promises puzzle cheat sheet
@neo22s
neo22s / formatcurrency.php
Created March 18, 2014 14:41
NumberFormatter formatCurrency alternative
<?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
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active March 27, 2024 06:36
A badass list of frontend development resources I collected over time.
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 11, 2024 07:57
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

Instructions

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

@anandpdoshi
anandpdoshi / install_erpnext.py
Last active October 11, 2015 06:37
ERPNext Installer
#!/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
@robcowie
robcowie / mysqldb_query_generator.py
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)
c.execute(query)
while True:
nextrows = c.fetchmany(arraysize)
if not nextrows:
break