Skip to content

Instantly share code, notes, and snippets.

View prakaashkpk's full-sized avatar

Prakash prakaashkpk

View GitHub Profile
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@prakaashkpk
prakaashkpk / mysql-docker.sh
Created May 2, 2019 14:32 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@prakaashkpk
prakaashkpk / gist:9d2716aee7a747f6bb4219d366b7b3ac
Created January 9, 2017 01:27 — forked from danielestevez/gist:2044589
GIT Commit to an existing Tag
1) Create a branch with the tag
git branch {tagname}-branch {tagname}
git checkout {tagname}-branch
2) Include the fix manually if it's just a change ....
git add .
git ci -m "Fix included"
or cherry-pick the commit, whatever is easier
git cherry-pick {num_commit}
@prakaashkpk
prakaashkpk / better-nodejs-require-paths.md
Created September 13, 2016 02:47 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@prakaashkpk
prakaashkpk / GarbageOnly_GarbageProducer
Created August 1, 2016 09:34 — forked from jsound/GarbageOnly_GarbageProducer
A simple GC micro benchmark that creates only objects of 0 lifetime (but as many of them as possible)
package de.am.gc.benchmarks;
/**
* A GC micro benchmark running a given number of threads that create objects of a given size and dereference them immediately
*
* @author jsound
*/
public class GarbageOnly {
// object size in bytes
private static final int DEFAULT_NUMBEROFTHREADS=8;