Skip to content

Instantly share code, notes, and snippets.

View iamso's full-sized avatar

Steve Ottoz iamso

View GitHub Profile
@jll90
jll90 / sw-testing.sh
Last active March 10, 2020 16:27
Chrome Treat Insecure Origin as Secure (useful for SW testing)
#For Ubuntu 16.04 LTS
#First you need to know where google-chrome is installed. To find out run:
which google-chrome
#For my case, google-chrome is installed inside both /usr/bin/google-chrome and /usr/bin/google-chrome-stable.
#I decided to use the stable version.
#Now, list the domains that you'd like chrome to treat as secure. Make sure that you have access to the folder following --user-data-dir. I used $HOME for convenience.
#Run the following command:
@DingGGu
DingGGu / stream.js
Last active March 26, 2024 06:13
NodeJS Mp3 Streaming ExpressJS
var express = require('express');
var app = express();
var fs = require('fs');
app.listen(3000, function() {
console.log("[NodeJS] Application Listening on Port 3000");
});
app.get('/api/play/:key', function(req, res) {
var key = req.params.key;
@rezoner
rezoner / easings.js
Created March 2, 2015 17:27
One argument easing equations
/*
A full list of simple easing equations inspired by GIST from greweb - https://gist.github.com/gre/1650294
Equations source - http://gsgd.co.uk/sandbox/jquery/easing/
*/
{
linear: function(t) {
return t
},
inQuad: function(t) {
@leonderijke
leonderijke / svgfixer.js
Last active May 26, 2023 11:22
Fixes references to inline SVG elements when the <base> tag is in use.
/**
* SVG Fixer
*
* Fixes references to inline SVG elements when the <base> tag is in use.
* Firefox won't display SVG icons referenced with
* `<svg><use xlink:href="#id-of-icon-def"></use></svg>` when the <base> tag is on the page.
*
* More info:
* - http://stackoverflow.com/a/18265336/796152
* - http://www.w3.org/TR/SVG/linking.html
@othiym23
othiym23 / npm-upgrade-bleeding.sh
Created September 20, 2014 19:36
a safe way to upgrade all of your globally-installed npm packages
#!/bin/sh
set -e
set -x
for package in $(npm -g outdated --parseable --depth=0 | cut -d: -f3)
do
npm -g install "$package"
done
@suranyami
suranyami / index.html
Created September 18, 2014 07:55
Minimal Rivets.js example
<div id="details">
<h1 id='head'>{user.firstName}</h1>
<h2 rv-text='user.surname'></h2>
<input id='input' type='text' rv-value="user.firstName">
</div>
<script src='rivets.js'></script>
<script>
var user = {
@AndreiD
AndreiD / ubuntu server after install TODO
Last active July 31, 2018 18:06
UBUNTU / MINT SERVER - AFTER INSTALL TODO
[ SERVER PART ] (for desktop, scroll down)
sudo apt install -y build-essential libssl-dev libncurses5-dev libpcap-dev git apt-transport-https ca-certificates
git config --global core.autocrlf false
git config --global core.longpaths true
// NodeJS
cd /tmp
curl -sL https://deb.nodesource.com/setup_10.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
@subfuzion
subfuzion / mongo-autostart-osx.md
Last active March 2, 2022 00:57
mongo auto start on OS X

Install with Homebrew

brew install mongodb

Set up launchctl to auto start mongod

$ ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents

/usr/local/opt/mongodb/ is a symlink to /usr/local/Cellar/mongodb/x.y.z (e.g., 2.4.9)

string meaning
------ -------
@reboot Run once, at startup.
@yearly Run once a year, "0 0 1 1 *".
@annually (same as @yearly)
@monthly Run once a month, "0 0 1 * *".
@weekly Run once a week, "0 0 * * 0".
@daily Run once a day, "0 0 * * *".
@midnight (same as @daily)
@hourly Run once an hour, "0 * * * *".
@grenade
grenade / 01-generate-ed25519-ssh-key.sh
Last active May 2, 2024 23:15
generate ed25519 ssh and gpg/pgp keys and set file permissions for ssh keys and config
#!/bin/bash
# generate new personal ed25519 ssh key
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C "rob thijssen <rthijssen@gmail.com>"
# generate new host cert authority (host_ca) ed25519 ssh key
# used for signing host keys and creating host certs
ssh-keygen -t ed25519 -f manta_host_ca -C manta.network
eval "$(ssh-agent -s)"