Skip to content

Instantly share code, notes, and snippets.

View streetgt's full-sized avatar

Tiago Cardoso streetgt

View GitHub Profile
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev -y
sudo apt-get install libfreetype6 libfreetype6-dev -y
sudo apt-get install libfontconfig1 libfontconfig1-dev -y
cd ~
export PHANTOM_JS="phantomjs-2.1.1-linux-x86_64"
wget https://github.com/Medium/phantomjs/releases/download/v2.1.1/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
@useless-stuff
useless-stuff / php_observer_pattern_spl.php
Last active May 20, 2023 23:54
PHP - Observer pattern with SPL
<?php
abstract class Event
{
public $name, $code;
public function __toString()
{
return $this->name . ' ' . $this->code;
}
@meew0
meew0 / djs-voice-example.js
Created November 28, 2015 12:50
@hydrabolt's discord.js voice example which was used for testing during development. I slightly changed some things and added lots of comments. The original is since gone from the repo but it can still be found in the history: http://git.io/vBi9P
var Discord = require("discord.js");
// Make a client to add events to
var client = new Discord.Client();
var request = require("superagent");
// Debug and warning handlers, these log debug messages and warnings to console
client.on("debug", (m) => console.log("[debug]", m));
client.on("warn", (m) => console.log("[warn]", m));
@omurphy27
omurphy27 / Show bootstrap modal window only once onload via JS Cookie.html
Last active May 22, 2019 16:27
Show bootstrap modal window only once onload via JS Cookie.js
@techslides
techslides / cards-shuffle.go
Last active January 4, 2023 05:34
Shuffle Array of Objects with Go Lang
package hello
import (
"net/http"
"github.com/go-martini/martini"
"github.com/martini-contrib/cors"
"github.com/martini-contrib/render"
"math/rand"
)
@sokil
sokil / spl.observer.php
Last active November 23, 2017 22:00
PHP SPL Observer pattern
<?php
class Observable implements \SplSubject
{
private $_observers = array();
public function notify()
{
foreach($this->_observers as $observer) {
$observer->update($this);
@glennschler
glennschler / Setup OpenVPN.md
Last active March 5, 2023 00:13
Setup OpenVPN server running on Amazon ec2.

OpenVPN Technologies has provided their SSL VPN solution in a free virtual machine image that can be hosted in the Amazon cloud. This allows anyone to quickly setup their own VPN solution to provide secure internet access, or a secure network between local and remote locations. With Amazon EC2 the cost can be free for the first year, and then can cost less than one US cent ($.005) per hour depending on configuration and bandwidth needs. The OpenVPN license is free for the first two users.

The instructions given by OpenVPN are thorough and easy to follow. They also describe an optional step on how to setup an Amazon static IP address. For free tier or other users who will leave the instance running full-time there is zero cost for this static IP, but for users who plan to only run the VPN on an hourly basis there will be additional ip "reservation" cost for e