Skip to content

Instantly share code, notes, and snippets.

View natchiketa's full-sized avatar

Sara Lara natchiketa

View GitHub Profile
@natchiketa
natchiketa / passgen.js
Created June 25, 2020 07:34
generate strong password in js
var specials = '!@#$%^&*()_+{}:"<>?\|[];\',./`~';
var lowercase = 'abcdefghijklmnopqrstuvwxyz';
var uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
var numbers = '0123456789';
var all = specials + lowercase + uppercase + numbers;
String.prototype.pick = function(min, max) {
var n, chars = '';
@natchiketa
natchiketa / nordls
Last active January 14, 2019 22:39
Ruby script to find the nearest ~50 NordVPN servers with a low load. Requires (free) API key from ipstack.com
#!/usr/bin/env ruby
require 'net/http'
require 'json'
# SET THIS TO YOUR LOCATION (an easy way is to go to maps.google.com and click the map and copy
# paste from the new URL)
MY_LATLNG = [ YOUR_LAT, YOUR_LONG ]
# GET A FREE API KEY FROM ipstack.com
IPSTACK_API_KEY = 'YOUR_IPSTACK_API_KEY'
@natchiketa
natchiketa / GIF-Screencast-OSX.md
Last active August 15, 2018 19:08 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@natchiketa
natchiketa / set-env.ts
Last active June 14, 2023 12:35
Use system environment variables to generate Angular CLI environment files. Uses yargs and dotenv
import { writeFile } from 'fs';
import { argv } from 'yargs';
// This is good for local dev environments, when it's better to
// store a projects environment variables in a .gitignore'd file
require('dotenv').config();
// Would be passed to script like this:
// `ts-node set-env.ts --environment=dev`
// we get it from yargs's argv object
@natchiketa
natchiketa / environment.prod.ts
Last active June 15, 2017 11:46
environment.prod.ts (Angular CLI v1.1.0)
export const environment = {
production: true
};
@natchiketa
natchiketa / environment.ts
Created June 15, 2017 11:37
environment.ts (Angular CLI v1.1.0)
// The file contents for the current environment will overwrite these during build.
// The build system defaults to the dev environment which uses `environment.ts`, but if you do
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.
export const environment = {
production: false
};
@natchiketa
natchiketa / get-s3-bucket-size.sh
Last active June 5, 2017 11:24
Get the size of your S3 Buckets with the AWS cli
# SETUP
# assumes macOS and Homebrew are installed
# Get Python 3
brew install python3
# Get pip (pip3 for Python 3)
curl -O https://bootstrap.pypa.io/get-pip.py
# Use pip3 to get the awscli package
pip3 install --user --upgrade awscli
# I had to add the following line to my dotfiles (i.e. my .bash_profile) to add it to my $PATH:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.