Skip to content

Instantly share code, notes, and snippets.

@princenaman
princenaman / image2base64.js
Created November 26, 2019 13:05 — forked from jfsiii/image2base64.js
Convert a remote image to Base64-encoded string
// Uses [request](https://github.com/mikeal/request)
// /?url=http://nodejs.org/logo.png
// /?uri=http://nodejs.org/logo.png
// /?url=http://nodejs.org/logo.png&cb=cbName
// /?url=http://nodejs.org/logo.png&callback=cbName
var fs = require('fs');
var url = require('url');
var http = require('http');
var request = require('request');

Keybase proof

I hereby claim:

  • I am princenaman on github.
  • I am namankhator (https://keybase.io/namankhator) on keybase.
  • I have a public key ASBJ3aO_g-4J_gJoqhsXBH_lQwcylopz0pnkFc3mxg30ZQo

To claim this, I am signing this object:

@princenaman
princenaman / README.md
Created May 24, 2018 07:26 — forked from jonathantneal/README.md
Local SSL websites on macOS

Local SSL websites on macOS Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
@princenaman
princenaman / predict.js
Created June 17, 2017 13:19 — forked from dgonzo/predict.js
Predictions with AWS Machine Learning w/ JavaScript (Node.js)
/*
Setup your aws account and create a credentials file:
$ mkdir ~/.aws # if it doesn't exist
$ cat <<'EOF' >> ~/.aws/credentials
[default]
aws_secret_access_key = "secret key"
aws_access_key_id = "your id"
EOF
Install aws module:
@princenaman
princenaman / gist:9f7953f904cc6b3d41b4422c6c738e21
Created May 29, 2017 08:38 — forked from incredimike/variousCountryListFormats.js
Country list as javascript array (alphabetical)
// This needs tidied up before production TODO
var country_list = ["Afghanistan","Albania","Algeria","Andorra","Angola","Anguilla","Antigua &amp; Barbuda","Argentina","Armenia","Aruba","Australia","Austria","Azerbaijan","Bahamas"
,"Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Benin","Bermuda","Bhutan","Bolivia","Bosnia &amp; Herzegovina","Botswana","Brazil","British Virgin Islands"
,"Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Canada","Cape Verde","Cayman Islands","Chad","Chile","China","Colombia","Congo","Cook Islands","Costa Rica"
,"Cote D Ivoire","Croatia","Cruise Ship","Cuba","Cyprus","Czech Republic","Denmark","Djibouti","Dominica","Dominican Republic","Ecuador","Egypt","El Salvador","Equatorial Guinea"
,"Estonia","Ethiopia","Falkland Islands","Faroe Islands","Fiji","Finland","France","French Polynesia","French West Indies","Gabon","Gambia","Georgia","Germany","Ghana"
,"Gibraltar","Greece","Greenland","Grenada","Guam","Guatemala","Guernsey","Guinea","G
{
"countries": [
{
"country": "Afghanistan",
"states": ["Badakhshan", "Badghis", "Baghlan", "Balkh", "Bamian", "Daykondi", "Farah", "Faryab", "Ghazni", "Ghowr", "Helmand", "Herat", "Jowzjan", "Kabul", "Kandahar", "Kapisa", "Khost", "Konar", "Kondoz", "Laghman", "Lowgar", "Nangarhar", "Nimruz", "Nurestan", "Oruzgan", "Paktia", "Paktika", "Panjshir", "Parvan", "Samangan", "Sar-e Pol", "Takhar", "Vardak", "Zabol"]
},
{
"country": "Albania",
"states": ["Berat", "Dibres", "Durres", "Elbasan", "Fier", "Gjirokastre", "Korce", "Kukes", "Lezhe", "Shkoder", "Tirane", "Vlore"]
},
@princenaman
princenaman / countrylist.php
Created April 21, 2017 14:06
ISO Country List
$countryList = array(
'AF' => 'Afghanistan',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
'AO' => 'Angola',
'AI' => 'Anguilla',
'AQ' => 'Antarctica',
'AG' => 'Antigua and Barbuda',
@princenaman
princenaman / ffmpeg-helper.md
Last active August 19, 2018 12:53
ffmpeg code snippets

Encoding Video

Installing

Install FFmpeg with homebrew. All codecs.

brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265