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 September 5, 2024 06:49
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
@johncf
johncf / backup.json
Last active May 18, 2024 11:28
Vimium configuration
{
"keyMappings": "map h scrollUp\nmap k scrollDown\nmap j scrollLeft\n\nmap H previousTab\nmap K nextTab\nmap J goBack\n\nunmap zH\nunmap zL",
"linkHintCharacters": "arstwfpzxcvgd",
"searchEngines": "w: https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s Wikipedia\ng: https://www.google.com/search?q=%s Google\ny: https://www.youtube.com/results?search_query=%s Youtube\naz: https://www.amazon.in/s/?field-keywords=%s Amazon India\ngm: https://www.google.com/maps?q=%s Google Maps\nfk: https://www.flipkart.com/search?q=%s Flipkart",
"searchUrl": "https://duckduckgo.com/?q=",
"settingsVersion": "2.1.2",
"exclusionRules": [
{
"passKeys": "",
"pattern": "https?://mail.google.com/*"