Skip to content

Instantly share code, notes, and snippets.

@jakjothi
jakjothi / cryptojs_base64_encrypt_decrypt.js
Created June 16, 2016 14:05 — forked from joecliff/cryptojs_base64_encrypt_decrypt.js
An example of base64 usage in cryptojs
var CryptoJS = require("crypto-js");//replace thie with script tag in browser env
//encrypt
var rawStr = "hello world!";
var wordArray = CryptoJS.enc.Utf8.parse(rawStr);
var base64 = CryptoJS.enc.Base64.stringify(wordArray);
console.log('encrypted:', base64);
//decrypt
var parsedWordArray = CryptoJS.enc.Base64.parse(base64);
@jakjothi
jakjothi / Timer.swift
Created June 26, 2016 18:39 — forked from jstn/Timer.swift
simple nanosecond timer using mach_absolute_time
/*
var t = Timer()
t.start()
// do something
t.stop()
println("took \(t.seconds)")
*/
@jakjothi
jakjothi / link_string.swift
Created July 15, 2016 11:28 — forked from chsh/link_string.swift
Show link text on NSTextField for OS X by swift.
@jakjothi
jakjothi / getMACAddress.swift
Created September 21, 2016 10:08 — forked from ericdke/getMACAddress.swift
Swift OS X: get MAC address for en0
/ Returns an iterator containing the primary (built-in) Ethernet interface. The caller is responsible for
// releasing the iterator after the caller is done with it.
func FindEthernetInterfaces() -> io_iterator_t? {
let matchingDictUM = IOServiceMatching("IOEthernetInterface");
// Note that another option here would be:
// matchingDict = IOBSDMatching("en0");
// but en0: isn't necessarily the primary interface, especially on systems with multiple Ethernet ports.
if matchingDictUM == nil {
@jakjothi
jakjothi / foo.md
Created November 30, 2016 19:15 — forked from rmoff/foo.md
cx_Oracle install on MacOS
  1. Download Instant Client:
  • instantclient-basic-macos.x64-11.2.0.4.0.zip
  • instantclient-sdk-macos.x64-11.2.0.4.0.zip
  • instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
  1. Unzip and move to /opt

  2. Create symlink

@jakjothi
jakjothi / .env.local.php
Created May 18, 2017 10:15 — forked from petehouston/.env.local.php
[Laravel 4.2] The environment dotfile configuration
<?php
//file: /.env.local.php
// return the configuration for the 'local' environment
return array(
'db_host' => '127.0.0.1',
'db_name' => 'DB_NAME', // specify database name
'db_user' => 'DB_USER', // specify database username
'db_pass' => 'DB_PASS', // specify database password
);
@jakjothi
jakjothi / waitReady.js
Created July 1, 2017 07:17 — forked from elgalu/waitReady.js
Actively wait for an element present and displayed up to specTimeoutMs ignoring useless webdriver errors like StaleElementError.
/**
* Actively wait for an element present and displayed up to specTimeoutMs
* ignoring useless webdriver errors like StaleElementError.
*
* Usage:
* Add `require('./waitReady.js');` in your onPrepare block or file.
*
* @example
* expect($('.some-html-class').waitReady()).toBeTruthy();
*/
@jakjothi
jakjothi / boto_dynamodb_methods.py
Created August 21, 2019 13:20 — forked from martinapugliese/boto_dynamodb_methods.py
Some wrapper methods to deal with DynamoDB databases in Python, using boto3.
# Copyright (C) 2016 Martina Pugliese
from boto3 import resource
from boto3.dynamodb.conditions import Key
# The boto3 dynamoDB resource
dynamodb_resource = resource('dynamodb')
def get_table_metadata(table_name):
@jakjothi
jakjothi / languages.json
Created November 10, 2021 07:33
List of Languages & Code
[
{
"code": "ab",
"name": "Abkhaz"
},
{
"code": "aa",
"name": "Afar"
},
{