Skip to content

Instantly share code, notes, and snippets.

View jdkanani's full-sized avatar
🎯
Focusing

Jaynti Kanani jdkanani

🎯
Focusing
View GitHub Profile

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@jdkanani
jdkanani / gpg-import-and-export-instructions.md
Created July 6, 2018 05:34 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@jdkanani
jdkanani / server.js
Last active August 29, 2015 14:09 — forked from ziahamza/server.js
var http = require('http'),
fs = require('fs'),
path = require('path'),
exec = require('child_process').exec;
function pipeDoc(inputPath, finalType, stream) {
var finalPath = path.dirname(inputPath)
+ "/" + path.basename(inputPath).split('.')[0] + ".html";
var convCommand = 'unoconv -f ' + finalType + " " + inputPath;
exec(convCommand,function(err, stdout, stderr) {
@jdkanani
jdkanani / notepad.html
Last active April 6, 2024 17:09 — forked from jakeonrails/Ruby Notepad Bookmarklet
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`