Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>imgur oauth</title>
<script src="http://code.jquery.com/jquery.min.js"></script>
<script>
$(function () {
var extractToken = function(hash) {
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
var net = require('net')
var sock = net.connect(1337)
process.stdin.pipe(sock)
sock.pipe(process.stdout)
sock.on('connect', function () {
process.stdin.resume();
process.stdin.setRawMode(true)
@hagb4rd
hagb4rd / dabblet.css
Last active August 29, 2015 14:13 — forked from gcyrillus/dabblet.css
/* Gcyrillus - exemple */
html {
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
}
@keyframes hover_me {
0%, 100% {font-size:1em;}
50% {font-size:5em;}
}
#!/usr/bin/env node
var argv = require('optimist')
.usage('Usage: --key=[consumer key] -secret=[consumer secret]')
.demand(['key', 'secret'])
.argv
;
var OAuth = require('oauth').OAuth;
var Step = require('step');
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@hagb4rd
hagb4rd / levenshtein.js
Created January 8, 2016 16:38 — forked from andrei-m/levenshtein.js
Levenshtein distance between two given strings implemented in JavaScript and usable as a Node.js module
/*
Copyright (c) 2011 Andrei Mackenzie
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
@hagb4rd
hagb4rd / vpnguide.md
Created May 13, 2016 12:31
Setting up a private OpenVPN server [Linux users only]

Setting up a private OpenVPN server [Linux users only]

This guide is an updated/complete/generalized version of http://azure-openvpn.github.io/ for Linux users. The aim is to get an OpenVPN server up and connect to it from your local machine, thus getting your own "private" VPN server and on-demand fast VPN network access.

Obligatory Theory

This is all important to know, period.

  • VPN is a layer between your PC and the outside world
  • VPN masks your PC from the outside world (it theoretically can't mask you from your ISP, though)
@hagb4rd
hagb4rd / CURL-cheatsheet.md
Created May 19, 2016 08:47 — forked from Kartones/CURL-cheatsheet.md
CURL Cheatsheet
  • XML GET
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET "http://hostname/resource"
  • JSON GET
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET "http://hostname/resource"
  • JSON PUT
@hagb4rd
hagb4rd / 0_reuse_code.js
Created June 15, 2016 10:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console