Skip to content

Instantly share code, notes, and snippets.

View jikkujose's full-sized avatar

Jikku Jose jikkujose

View GitHub Profile
@jikkujose
jikkujose / index.html
Created November 15, 2021 06:51
Minimum PWA that satisfies Lighthouse tests
<!DOCTYPE html>
<html lang="en">
<!--
Steps to acheive perfect Lighthouse score
- [ ] Add service worker as separate file (sw.js)
- [ ] Uncomment registering of service worker (sw.js)
- [ ] Add `start_url` corresponding to where you host
- [ ] Add <link rel="canonical" href="link-to-show-up-in-search"/>
-->
@jikkujose
jikkujose / totp.rb
Created August 5, 2021 13:02
Generate TOTP codes from command line
require "rotp"
key = STDIN.tty? ? ARGV[0] : $stdin.read
if key.nil?
puts "Error: No key found in stdin or as flag"
exit
end
puts ROTP::TOTP.new(key.strip, issuer: "Unnamed Service").now
@jikkujose
jikkujose / private_opera.js
Last active September 16, 2020 17:13
Apple Script JAX snippet to create an application to start Opera in private mode by default in macOS
try {
opera = Application("Opera")
privateWindow = opera.Window({ mode: "incognito" })
opera.windows.push(privateWindow)
} catch {
console.log("Error")
}
/*
@jikkujose
jikkujose / node_modules.sh
Last active July 30, 2020 14:11
Manage node_modules. See how much storage they consume & remove them.
alias nm_weight="find . -name 'node_modules' -type d -prune -print0 | xargs -0 du -chs"
alias nm_delete="find . -name 'node_modules' -type d -prune -print0 | xargs -0 rm -rf"
[~/Projects] $ nm_weight
129M ./dojo/02 - Game of Life/username/typescript/node_modules
133M ./dojo/03 - Mandelbrot Set/username/node_modules
406M ./BCProject/code/mobile/BCProject/node_modules
224M ./main/node_modules
319M ./count_tracker/node_modules
236M ./SB/exercism/username/reasonml/two-fer/node_modules
@jikkujose
jikkujose / resize.rb
Created December 10, 2018 04:13
DSLR image import
#! /usr/bin/env ruby
require 'fileutils'
def resize(image_file, resolution = 1920, resize_directory = "resized")
basename = File.basename(image_file, ".CR2").split(".")[0]
FileUtils.mkdir_p resize_directory
%x|sips -Z #{resolution} -s format jpeg "#{image_file}" --out "#{resize_directory}/#{basename}.jpg"|
end
yarn add react-router-dom --save
import { BrowserRouter as Router, Switch, Route } from "react-router-dom"
<Router basename={basename}>
<Switch>
<Route exact path="/" component={Home} />
<Route exact path="/blog" component={Blog} />
<Route
exact
@jikkujose
jikkujose / trivandrum.txt
Created December 2, 2018 11:37
Entities that handle document apostiling in Trivandrum
Passport Office Thiruvanthapuram SNSM. Building, Karalkada Junction, Kaithamukku, Thiruvanthapuram- 695024
Tel: 0471-2460132, 2470225
Fax: 0471-2461132 rpo.trivandrum@mea. gov.in
---
Shri George Dilip George
Tel: 0471-2334134 +91-7736560001
Email:
tvm@seplgroup.com
Balance | Addresses | Coins
---------------------- | ------------ | -------------
0 - 0.001 | 13752848 | 2,451
0.001 - 0.01 | 4749446 | 19,499
0.01 - 0.1 | 3893295 | 122,612
0.1 - 1 | 1652775 | 533,117
1 - 10 | 542637 | 1,447,283
10 - 100 | 133620 | 4,412,941
100 - 1,000 | 16301 | 3,809,684
1,000 - 10,000 | 1563 | 3,401,708
@jikkujose
jikkujose / list.txt
Created November 18, 2017 08:48
Syro Malabar Parishes
Dublin, Ireland, Syro Malabar Church
9 Worswick Street, St. Andrew's RC Church
Aarau, Aarau
Abbasiya, Kuwait, St. Daniel Comboni
Aberdeen, Kerala Catholic Community Aberdeen, Scotland
Aberdeen, Holy Family Church Deveron Road
Abhyagiri-Valayam, St. Mary's Church
Abu Dhabi, Syro-Malabar Catholic Community Oman
Achinakom, St. Antony's Church
Adackakundu, St.George Church
export function repeat(object, number) {
let array = []
for(let i = 0; i < number; i++) {
array.push(object)
}
return array
}