Skip to content

Instantly share code, notes, and snippets.

View nolochemical's full-sized avatar

Victor Phelemba nolochemical

  • Toronto, Ontario
View GitHub Profile
@nolochemical
nolochemical / Mac Ramdisk Script
Created April 14, 2020 19:32
RamdiskScript ( Mac )
RD_SIZE=600 #MB
print_usage() {
echo "\n *With great power comes great responsibility* \n\nUsage: $0 \n -c create a ramdisk with -n <diskname>\n -d delete a disk with -n <diskname>\n Manually *Caution*: \n $ hdiutils detach /dev/<diskname> \n\nAll Mounted Disks\n=================\n`mount | sort`\n=================\n " 1>&2; exit 1;
}
while getopts 'n:cdv' flag; do
case "${flag}" in
n) if [ -z "$flag" ]; then
echo Please enter a disk name

Keybase proof

I hereby claim:

  • I am nolochemical on github.
  • I am nolochemical (https://keybase.io/nolochemical) on keybase.
  • I have a public key ASCwn8uYAvUjOionkYy-4wvWCHnm161hFVjgPb4CG9K2EAo

To claim this, I am signing this object:

@nolochemical
nolochemical / Multiquote JSONDecoder
Created March 19, 2020 02:14
Alpha vantage api response decoder, for symbol search
import Foundation
struct MultiQuotes: Decodable{
var symbol: String
var name: String
var type: String
var region: String
var marketOpen: String
var marketClose: String
var timeZone: String
@nolochemical
nolochemical / Swift JSON Decoder
Created March 12, 2020 16:27
Fairly straight forward JSONDecoder with a single nest
import Foundation
let i = """
{
"Global Quote":{
"01. symbol": "MSFT",
"02. open": "157.1304",
"03. high": "157.7000",
"04. low": "151.1500",
"05. price": "153.6300",
let str = '/alpha/bravo/charlie/delta/echo/foxtrot/golf/hotel/india/juliett/kilo/lima/mike/november/oscar/papa/quebec/romeo/sierra/tango/uniform/victor/wisky/xray/yankee/zulu'
#!/usr/bin/env bash
# usage:
# $ 384sum ./myModule.js
shasum -b -a 384 $1 | awk '{ print $1 }' | xxd -r -p | base64
@nolochemical
nolochemical / JS script loader
Created September 4, 2019 15:53
Quick and dirty JSL add to path with `Async Defer`
(function (id, src, attrs) {
// find in DOM
if (document.getElementById(id)) {
return;
}
//create new node
var js = document.createElement('script');
js.src = src;
js.type = 'text/javascript';
js.id = id;
@nolochemical
nolochemical / McGuiverTheThings.java
Last active May 16, 2018 01:37
Android Room Type Converters For Slighty Complex Data - How to Use
/// start file Linkthing.class - used where your insert data
usage:
Collection col = new ArrayList();
col.add(new LP("ddg", "http://duckduckgo"));
// in db insert routine
...setLinkthing(col);
// You'll get something like this in your db rows .. SELECT * FROM linkthings WHERE links = ' [{"ddg", "http://duckduckgo"}] '
[{"ddg", "http://duckduckgo"}]
@nolochemical
nolochemical / B2B Lead Request Email
Created March 23, 2018 21:04
B2B Lead Request Email
I had a quick glimpse of your company profile, I would like to discuss if you would be interested in acquiring Industry Professionals Contacts to accelerate your sales/marketing activities.
We do provide 19 different fields including Contact Name, Company Name, Website address, Physical Address, Phone Number, Fax Number, Email Address, SIC Code, Industry Type, Revenue size, Employee Size etc. which helps you to meet thousands of new prospects to enhance your business.
If it sounds of value, please provide me the below information required and I will get a list of potential clients as per your requirement.
Target Industry: ______________ (Any Industry)
Target Geography: ______________ (Worldwide)
Target Job Title: ______________ (Any Title)
@nolochemical
nolochemical / jdr.sh
Last active December 12, 2017 01:27
Java Dark Room bash script
# java -jar JDarkRoom.jar
# http://www.codealchemists.com/jdarkroom/
# after downloading $ chmod +x jdr.sh to make executable
#
if [ {$1} != "" ]; then
# the filename is included
java -jar JDarkRoom.jar $1
else
java -jar JDarkRoom.jar