Skip to content

Instantly share code, notes, and snippets.

View wstam88's full-sized avatar

Wesley wstam88

  • Netherlands, Amsterdam
View GitHub Profile
/**
* Copyright JS Foundation and other contributors, http://js.foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@wstam88
wstam88 / init.sh
Created April 19, 2017 07:18 — forked from tmiller/init.sh
DigitalOcean ubuntu 14.04 server configuration script.
#!/bin/bash
username="ubuntu"
ssh_pub_key=""
# Setup user
adduser $username
usermod -a -G sudo $username
sudo mkdir -p "/home/${username}/.ssh"
sudo echo "${ssh_pub_key}" > "/home/${username}/.ssh/authorized_keys"
@wstam88
wstam88 / install.sh
Created March 4, 2017 11:43 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@wstam88
wstam88 / index.html
Created December 22, 2016 21:52 — forked from suranyami/index.html
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 = {
@wstam88
wstam88 / uniq.js
Created December 20, 2016 10:14 — forked from telekosmos/uniq.js
Remove duplicates from js array (ES5/ES6)
var uniqueArray = function(arrArg) {
return arrArg.filter(function(elem, pos,arr) {
return arr.indexOf(elem) == pos;
});
};
var uniqEs6 = (arrArg) => {
return arrArg.filter((elem, pos, arr) => {
return arr.indexOf(elem) == pos;
});
@wstam88
wstam88 / .profile
Created December 15, 2016 12:20 — forked from xdamman/.profile
alias reload="source ~/.profile"
#function ssh {
# ~/.scripts/iterm-setName $1
# /usr/bin/ssh $1
#}
# git alias
alias gco="git commit -am"
alias glog='git log --date-order --all --graph --format="%C(green)%h%Creset %C(yellow)%an%Creset %C(blue bold)%ar%Creset %C(red bold)%d %Creset%s"'
@wstam88
wstam88 / install_ffmpeg_ubuntu.sh
Created December 14, 2016 08:22 — forked from xdamman/install_ffmpeg_ubuntu.sh
Install latest ffmpeg on ubuntu 12.04 or 14.04
#!/bin/bash
# Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04
# Inspired from https://gist.github.com/faleev/3435377
# Remove any existing packages:
sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev
# Get the dependencies (Ubuntu Server or headless users):
sudo apt-get update
@wstam88
wstam88 / cors-nginx.conf
Created October 19, 2016 10:52 — forked from michiel/cors-nginx.conf
Wide-open CORS config for nginx
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
@wstam88
wstam88 / nginx.conf
Created September 20, 2016 17:58 — forked from Stanback/nginx.conf
Example Nginx configuration for serving pre-rendered HTML from Javascript pages/apps using the Prerender Service (https://github.com/collectiveip/prerender). Instead of using try_files (which can cause unnecessary overhead on busy servers), you could check $uri for specific file extensions and set $prerender appropriately.
server {
listen 80;
listen [::]:80;
server_name yourserver.com;
root /path/to/your/htdocs;
error_page 404 /404.html
index index.html;
#!/bin/bash
if [ "$GIT_SSH_KEY" != "" ]; then
echo "Cleaning up SSH config" >&1
echo "" >&1
# Now that npm has finished running,
# we shouldn't need the ssh key/config anymore.
# Remove the files that we created.
rm -f ~/.ssh/config
rm -f ~/.ssh/deploy_key