Skip to content

Instantly share code, notes, and snippets.

View johncf's full-sized avatar

John Charankattu johncf

View GitHub Profile
The end result is the same. :: DH AH _ EH N D _ R IH Z AH L T _ IH Z _ DH AH _ S EY M .
@johncf
johncf / csv2json.py
Created July 3, 2017 08:23
Backblaze CSV data to JSON format using SMART names
#!/bin/python
import csv
import json
import sys
def key_proc(key):
return {
'smart_1_raw': '001R_read_err_rate',
'smart_1_normalized': '001N_read_err_rate',
@johncf
johncf / Java.md
Last active October 19, 2017 15:32
Introduction to Programming through Java

Java Tutorial

Terminology Note

A program may refer to something that can be readily run/executed (such as an application software), or it may refer to the entire "source code" that the application is generated from. Source Code refers to the human-readable form of the program that is written in a programming language such as Java. "Source code" is often shortened to just "code", although "code" often refers to smaller parts of the complete source code.

In short, "program", "source code" and "code" are very related terms, and for our purposes, we might use them interchangeably.

First Program

set path=%path%;C:\Program Files\7-Zip
7z x jdk8.exe -ojdk8
cd jdk8
7z x tools.zip
for /r %%w in (*.pack) do bin\unpack200 "%%w" "%%~dpnw.jar"
for /r %%w in (*.pack) do del "%%w"
del tools.zip javafx-src.zip
rmdir /S /Q db lib\missioncontrol lib\visualvm
@johncf
johncf / vimium.json
Last active December 9, 2017 17:28
Vimium config backup (colemak)
{
"settingsVersion": "1.62",
"exclusionRules": [
{
"pattern": "https?://mail.google.com/*",
"passKeys": ""
}
],
"filterLinkHints": false,
"waitForEnterForFilteredHints": true,
@johncf
johncf / mui2-custompage-nsd.nsi
Last active August 29, 2023 06:28
NSIS Example using MUI2 with a custom page built with NsDialogs.
!include nsDialogs.nsh
!include LogicLib.nsh
!include MUI2.nsh
Name nsDialogs
OutFile nsDialogs.exe
RequestExecutionLevel user
ShowInstDetails show
Var Dialog
# Maintainer: John C F <john.ch.fr [at] gmail [dot] com>
pkgname=woff2-bin
pkgver=1.0.2
_debver=1.0.2-1
pkgrel=1
pkgdesc="Utilities for converting TTF fonts to the compressed WOFF 2.0 format, and vice versa."
url="https://github.com/google/woff2"
arch=(x86_64)
license=(MIT)
@johncf
johncf / torr-details.py
Created March 28, 2018 19:24
Torrent: download specific pieces with libtorrent
#!/bin/env python3
import libtorrent as lt
with open("/path/to/file.torrent", "rb") as f:
e = lt.bdecode(f.read())
info = lt.torrent_info(e)
print(info.num_pieces(), 'pieces')
files = info.files()
def humanize(size_bytes):
P: Parts
C: Confusable
Ex: Example
Mn: Mnemonic
adv. -- adverb
n. -- noun
i-adj. -- I-adjective
na-adj. -- NA-adjective
prop. n. -- proper noun
unmap j
unmap k
unmap h
map j scrollLeft
map k scrollDown
map h scrollUp
unmap J
unmap H
map J goBack