Skip to content

Instantly share code, notes, and snippets.

View priyanshujain's full-sized avatar
🛠️
Always Building

Priyanshu Jain priyanshujain

🛠️
Always Building
View GitHub Profile
@priyanshujain
priyanshujain / vscode.json
Last active February 12, 2020 10:50
my python vscode setup
{
"editor.fontFamily": "Fira Code",
"editor.fontLigatures": true,
"workbench.editor.highlightModifiedTabs": true,
"files.autoSave": "afterDelay",
"explorer.sortOrder": "type",
"editor.cursorStyle": "block",
"editor.cursorBlinking": "smooth",
"files.trimFinalNewlines": true,
"editor.acceptSuggestionOnEnter": "off",
@priyanshujain
priyanshujain / new-timezone.json
Last active December 26, 2017 06:04
List of timezones
[
{
"value": "Dateline Standard Time",
"abbr": "DST",
"offset": -12,
"isdst": false,
"text": "(UTC-12:00) International Date Line West",
"utc": [
"Etc/GMT+12"
]
@sirodoht
sirodoht / migrate-django.md
Last active July 27, 2024 17:33
How to migrate Django from SQLite to PostgreSQL

How to migrate Django from SQLite to PostgreSQL

Dump existing data:

python3 manage.py dumpdata > datadump.json

Change settings.py to Postgres backend.

Make sure you can connect on PostgreSQL. Then:

@nitinbhojwani
nitinbhojwani / nmonitor.sh
Created March 23, 2017 07:28
Monitor individual process metrics - nmonitor usage and shell script.
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "usage error: sh nmonitor.sh <pid> <time_to_monitor_in_seconds>";exit 1
fi
pid=$1
time=$2
#read -p "Please enter your process Id: " pid

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@kiasaki
kiasaki / readme.md
Last active June 7, 2024 14:57
ubuntu: vboxdrv module signing for secureboot to load it

Since kernel version 4.4.0-20, it was enforced that unsigned kernel modules will not be allowed to run with Secure Boot enabled. Because you want to keep Secure Boot, then the next logical step is to sign those modules.

So let's try it.

Create signing keys

openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -nodes -days 36500 -subj "/CN=Descriptive name/"
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@manishtpatel
manishtpatel / main.go
Last active October 18, 2023 03:12
GoLang Encrypt string to base64 and vice versa using AES encryption.
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
)
@harperreed
harperreed / peter-thiels-cs183-startup-class-01-notes-essay.md
Created July 29, 2012 21:20
Notes Essays—Peter Thiel’s CS183: Startup—Stanford, Spring 2012

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble

@p3drosola
p3drosola / validateXML.js
Created April 5, 2012 09:33
Javascript XML validation
function validateXML(txt)
{
// code for IE
if (window.ActiveXObject)
{
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.loadXML(document.all(txt).value);
if(xmlDoc.parseError.errorCode!=0)