Skip to content

Instantly share code, notes, and snippets.

@thesagarsutar
thesagarsutar / ID.js
Created April 17, 2021 09:02
ID - a unique ID/name generator for JavaScript
// Generate unique IDs for use as pseudo-private/protected names.
// Similar in concept to
// <http://wiki.ecmascript.org/doku.php?id=strawman:names>.
//
// The goals of this function are twofold:
//
// * Provide a way to generate a string guaranteed to be unique when compared
// to other strings generated by this function.
// * Make the string complex enough that it is highly unlikely to be
// accidentally duplicated by hand (this is key if you're using `ID`

Keybase proof

I hereby claim:

  • I am thesagarsutar on github.
  • I am thesagarsutar (https://keybase.io/thesagarsutar) on keybase.
  • I have a public key ASAKbqytnOHBY4KLNAw35ovBl1QS5PBnMRcw6WQJBOPNcQo

To claim this, I am signing this object:

@thesagarsutar
thesagarsutar / bootgui
Created January 9, 2016 05:28 — forked from SurealCereal/bootgui
Bash script to enable/disable the GUI on boot for Ubuntu Mate. Tested on Ubuntu Mate 15.04 on a Raspberry Pi 2 B.
#!/bin/bash
# Call with either enable or disable as first parameter
if [[ "$1" == 'enable' || "$1" == 'disable' ]]; then
sudo systemctl set-default multi-user.target --force
sudo systemctl $1 lightdm.service --force
sudo systemctl $1 graphical.target --force
sudo systemctl $1 plymouth.service --force
else
echo Call with either "enable" or "disable" as first parameter.
fi
@thesagarsutar
thesagarsutar / README.md
Last active August 29, 2015 14:18 — forked from oodavid/README.md

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/