Skip to content

Instantly share code, notes, and snippets.

('94.113.207.67', '5658')
('127.0.0.1', '5658')
('173.208.195.18', '5658')
('80.233.175.26', '5658')
('204.12.195.202', '5658')
('78.28.250.81', '5658')
('107.150.53.98', '5658')
('101.236.0.215', '5658')
('142.54.178.82', '5658')
('142.54.164.90', '5658')
sudo openvpn --config uk.openvpn.frootvpn.ovpn
Tue Apr 4 17:47:57 2017 OpenVPN 2.3.10 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Feb 2 2016
Tue Apr 4 17:47:57 2017 library versions: OpenSSL 1.0.2g 1 Mar 2016, LZO 2.08
Enter Auth Username: ********
Enter Auth Password: ********
Tue Apr 4 17:48:12 2017 UDPv4 link local: [undef]
Tue Apr 4 17:48:12 2017 UDPv4 link remote: [AF_INET]82.145.59.207:1196
Tue Apr 4 17:48:12 2017 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Tue Apr 4 17:48:18 2017 [server] Peer Connection Initiated with [AF_INET]82.145.59.207:1196
Tue Apr 4 17:48:21 2017 NOTE: Beginning empirical MTU test -- results should be available in 3 to 4 minutes.

#Node - File Paths

##File Paths Node has a path module which can be used to manipulate paths.

###Normalizing Paths Paths can be stored in different ways and it is neccessary to ensure that the path is standardized.

var path = require('path');
path.normalize('/foo/bar//baz/asdf/quux/..');

update object

var state = {
    id: 1,
    points: 100,
    name: "Goran"
};

var newState = {
SELECT `Interview`.`id`, `Interview`.`title`, `Interview`.`description`, `Interview`.`complete_state`, `Interview`.`state`,
`Interview`.`access_token`, `Interview`.`salary`, `Interview`.`salary_comments`, `Interview`.`is_advanced`,
`Interview`.`is_private`, `Interview`.`stuck`, `Interview`.`createdAt`, `Interview`.`updatedAt`, `Interview`.`employer_id`,
`interviewResponses`.`id` AS `interviewResponses.id`, `interviewResponses`.`state` AS `interviewResponses.state`,
`interviewResponses`.`current_question` AS `interviewResponses.current_question`,
`interviewResponses`.`token` AS `interviewResponses.token`,
`interviewResponses`.`createdAt` AS `interviewResponses.createdAt`,
`interviewResponses`.`updatedAt` AS `interviewResponses.updatedAt`,
`interviewResponses`.`interview_id` AS `interviewResponses.interview_id`,
@StasKoval
StasKoval / authentication.rb
Created April 11, 2016 11:17 — forked from theCrab/authentication.rb
A Hanami Framework authentication based on JSON Web Tokens.
# lib/authentications/authentication.rb
# @api auth
# Authentication base class
#
module Authentication
def self.included(base)
base.class_eval do
before :authenticate!
expose :current_user
"use strict";
const R = require('ramda');
const app = require('express')();
const Maybe = require('monet').Maybe;
const Left = require('monet').Left;
const Right = require('monet').Right;
@StasKoval
StasKoval / gist:7af0c5af3e619da45702
Created March 29, 2016 15:09 — forked from shovon/gist:5685073d03829f3b63d0
Haskell-style monads in JavaScript (ES6).
'use strict';
class Monad {
constructor(a) { this._value = a; }
'>>='(f) { return f(this.value()); }
static create(a) { return new Monad(a); }
value() { return this._value; }
}
var val = Monad.create(10) ['>>=']
@StasKoval
StasKoval / maybe.traceur
Created March 29, 2016 04:09 — forked from torgeir/maybe.traceur
An es6 js maybe monad, using generators
log = console.log.bind(console);
maybe = v => {
function * f () {
if (v) yield v;
}
f.bind = f =>
v ? f(v) : maybe();
class AuthenticateUser
attr_accessor :user
def initialize(authorization_code)
@authorization_code = authorization_code
end
def perform
token = app_client.exchange_code_for_token(@authorization_code)
user_data = user_client(token).user