Skip to content

Instantly share code, notes, and snippets.

View agoldis's full-sized avatar
🎯
Focused

Andrew Goldis agoldis

🎯
Focused
View GitHub Profile
@agoldis
agoldis / Install latest GNUstep on Ubuntu 14.04
Last active November 11, 2015 14:31
Install latest GNUstep on Ubuntu 14.04 for compiling ObjC
# Install pre-requesties
```
apt-get install cmake clang gobjc build-essential libblocksruntime-dev libkqueue-dev libpthread-workqueue-dev libxml2-dev libjpeg-dev libtiff-dev libpng12-dev libcups2-dev libfreetype6-dev libcairo2-dev libxt-dev libgl1-mesa-dev
```
# Install `libobjc2`
```bash
curl -O http://download.gna.org/gnustep/libobjc2-1.7.tar.bz2
tar -xvf libobjc2-1.7.tar.bz2
@agoldis
agoldis / gist:f873cc4962092a4bf808
Created March 29, 2016 10:48
get canonical user id for S3 access via Cloudront
aws cloudfront get-cloud-front-origin-access-identity --id EYH8HMULNGLMQ
@agoldis
agoldis / ReqRes.js
Created November 28, 2016 21:30
Request/response in Nodejs with postal and promises
import postal from 'postal'
import { v1 } from 'uuid'
export default class ReqRes {
static channel = 'reqres'
static request (topic, payload) {
var replyTo = {
channel: ReqRes.channel,
topic: topic + v1()
}
@agoldis
agoldis / createSSH.sh
Created February 13, 2017 22:03
nginx proxy for ssh tunnelling
#!/bin/bash
port=ARGV[1]
ssh -R $port:localhost:$port sshproxy
@agoldis
agoldis / README.md
Created February 13, 2017 22:06 — forked from gdamjan/README.md
Setup for an easy to use, simple reverse http tunnels with nginx and ssh. It's that simple there's no authentication at all. The end result, a single ssh command invocation gives you a public url for your web app hosted on your laptop.

What

A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.

Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).

Requirements

@agoldis
agoldis / example
Created July 5, 2017 12:52
google support exampl
Delivered-To: agoldis+lead15@rollout.io
Received: by 10.12.157.78 with SMTP id n14csp706940qvf;
Wed, 5 Jul 2017 05:20:59 -0700 (PDT)
X-Received: by 10.107.27.210 with SMTP id b201mr14798702iob.76.1499257259393;
Wed, 05 Jul 2017 05:20:59 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1499257259; cv=none;
d=google.com; s=arc-20160816;
b=O/TbkclP2a8BxzCXrJudncahAmEFhMjnEUYOoYX0rXIKPuyip8kdP5qdgyimwuyCb+
IslnQuAy1xdQ1VwOZXOrqIoztwkwDMMoZzK4uH/e8IQKLBssnKX5itu3oBOaV+XPevpg
BTNrx8XdIt3Z6NLrKCjjaeWXIz4kiaaSlBOqGgUcRfe90WZvFLvJmXnfsxOp4QSWLD9f
@agoldis
agoldis / roxlogger.js
Created August 6, 2017 13:01
Basic logger for node
const LOGLEVELS = {
mute: -1,
error: 0,
warn: 1,
info: 2,
debug: 3
}
let currentLevel = LOGLEVELS.mute
@agoldis
agoldis / .eslintrc.js
Created March 8, 2018 19:37
eslint + prettier config
module.exports = {
"extends": [
"standard",
"plugin:react/recommended",
"prettier",
"prettier/react",
"prettier/standard"
],
"plugins": [
"react",
@agoldis
agoldis / comment.java
Last active April 4, 2021 06:38
Comments frustration - comment example
List<ResultType> resultsList = new ArrayList<>();
final Double TWO = new Double(2);
final Double LIMIT = new Double(10);
for(ItemType item: itemsList) {
// add items' photos located within circle with radius LIMIT
// to a collection of photos
if(Math.pow(item.x, TWO) + Math.pow(item.y, TWO) < Math.pow(LIMIT, TWO)) {
resultsList.add(item.toResultType());
}
}
@agoldis
agoldis / renaming.java
Last active March 30, 2018 04:15
comment frustration - renaming
public List<PhotosCollection> getPhotosCollectionsWithinRadius(List<Locations> locationsList) {
List<PhotosCollection> photosCollection = new ArrayList<>();
final Double TWO = new Double(2);
final Double RADIUS = new Double(10);
for(Location location: locationsList) {
if((Math.pow(x, TWO) + Math.pow(y, TWO)) < Math.pow(RADIUS, TWO)) {
photosCollection.add(location.getPhotosCollection());
}