Skip to content

Instantly share code, notes, and snippets.

View chiragchamoli's full-sized avatar
💭
I may be slow to respond.

Chirag Chamoli chiragchamoli

💭
I may be slow to respond.
View GitHub Profile
@chiragchamoli
chiragchamoli / keywords.json
Created January 26, 2021 10:57 — forked from theikkila/keywords.json
7000 skill keywords
[
"Automotive",
"Budgeting",
"HVAC",
"Heaters",
"Hydraulics",
"Logistics Management",
"Management",
"Negotiation",
"Project Planning",
@chiragchamoli
chiragchamoli / business-keywords.py
Created January 26, 2021 10:57 — forked from samister2k/business-keywords.py
Business Studies keyword generator
print("welcome to the Business keyword generator")
print("these are your options as we are still working on this website")
print("Consumer")
print("Trader")
print("Brand name")
print("Contract")
print("Consideration")
print("Implied conditions")
print("3Rs")
print("Gurantee or Warranty")
@chiragchamoli
chiragchamoli / jshipster_and_and.js
Created September 9, 2018 15:48 — forked from berzniz/jshipster_and_and.js
Some small javascript hacks for hipsters
// Boring
if (isThisAwesome) {
alert('yes'); // it's not
}
// Awesome
isThisAwesome && alert('yes');
// Also cool for guarding your code
var aCoolFunction = undefined;
@chiragchamoli
chiragchamoli / generate-pushid.js
Created September 9, 2018 15:31 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@chiragchamoli
chiragchamoli / restful_routes.md
Created September 9, 2018 14:51 — forked from alexpchin/restful_routes.md
7 Restful Routes
URL HTTP Verb Action
/photos/ GET index
/photos/new GET new
/photos POST create
/photos/:id GET show
/photos/:id/edit GET edit
/photos/:id PATCH/PUT update
/photos/:id DELETE destroy
#!/bin/bash
kill -9 $(ps aux | grep 'uwsgi' | awk '{print $2}')
source /home/ubuntu/.env/myappenv/bin/activate
cd /home/ubuntu/myapp
kill -9 $(ps -aux | grep 'worker.py' | awk '{print $2}')
nohup redis-server &
nohup python -u worker.py > worker.out &
uwsgi --socket :8881 --plugin python --wsgi-file main.py --callable app --buffer-size 32768 --process 4 --logto /home/ubuntu/myapp/log/myapp.log &
@chiragchamoli
chiragchamoli / slugify.js
Created May 3, 2018 08:29 — forked from mathewbyrne/slugify.js
Javascript Slugify
function slugify(text)
{
return text.toString().toLowerCase()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}
@chiragchamoli
chiragchamoli / translate_amazon.js
Last active January 16, 2018 14:17 — forked from ideasasylum/translate_amazon.js
[Translate Amazon Service] #aws #meta
// ==UserScript==
// @name Translate Amazon
// @namespace http://your.homepage/
// @version 0.1
// @description Translate the Amazon service names into plain English. See https://www.expeditedssl.com/aws-in-plain-english
// @author @ideasasylum
// @match https://*.console.aws.amazon.com/console/home?*
// @grant none
// ==/UserScript==
@chiragchamoli
chiragchamoli / iterm2-solarized.md
Created November 20, 2016 12:02 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font (OS X / macOS)

Solarized

@chiragchamoli
chiragchamoli / pedantically_commented_playbook.yml
Created July 17, 2016 14:12 — forked from marktheunissen/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.