Skip to content

Instantly share code, notes, and snippets.

View albacoretuna's full-sized avatar

Nick O. albacoretuna

View GitHub Profile
// require an internal utility in node for running commands in command line
var exec = require('child_process').exec;
var child;
// get exec from that utily, give the command you want to run as it's first argument
child = exec('npm install ffi',
function (error, stdout, stderr) {
// these are the result, somehow, it's devided to when there's error, or output etc.
console.log('stdout: ' + stdout);
console.log('stderr: ' + stderr);
"use strict";
const request = require('request-promise');
const headers = {
'User-Agent': 'scottwrobinson'
};
const repos = [
'scottwrobinson/camo',
@albacoretuna
albacoretuna / bash-cheatsheet.sh
Created November 4, 2016 08:06 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
/*
var async = true;
var xhr = new XMLHttpRequest();
xhr.open('get', 'favicon.ico', async);
xhr.send();
var timestamp = Date.now() + 3000;
while(Date.now() < timestamp);
# from https://gist.github.com/sindresorhus/7996717
curl -O https://gist.githubusercontent.com/sindresorhus/7996717/raw/4ec63bc6f8c0f1e227faeb78eddc01a788ef0595/post-merge && chmod +x post-merge && mv post-merge .git/hooks/
@albacoretuna
albacoretuna / nginx_config_beanstalk.yaml
Created February 13, 2017 15:23
Nginx configuration for aws beanstalk, enables gzip, sets up node proxy
# All nginx configurations can go here
files:
# This creates a file at the address below on the beanstalk instance
/etc/nginx/conf.d/proxy.conf:
mode: "000644"
owner: root
group: root
content: |
upstream nodejs {
server 127.0.0.1:8081;
`;;;;;;
.@@@@@@
.@@+ @@@@@@+
`;@+ ;;;;;@+ @@@@@@@@@@@@@@@@@@@@@@
@@@+ @@@@@ @ @
;;@+ ;;;'@ @@@@@@@ @@@@@@@
@@@@@ .@@@ @@@@@@@ @@@@@@@
@;; .@;, @@@@@@@ @@@@@@@
@@@ .@@+ @@@@ @@@@@
<html class="gr__s_codepen_io"><head>
<meta charset="UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="https://production-assets.codepen.io/assets/favicon/favicon-8ea04875e70c4b0bb41da869e81236e54394d63638a1ef12fa558a4a835f1164.ico">
<link rel="mask-icon" type="" href="https://production-assets.codepen.io/assets/favicon/logo-pin-f2d2b6d2c61838f7e76325261b7195c27224080bc099486ddd6dccb469b8e8e6.svg" color="#111">
<title>CodePen - A Pen by Omid H</title>

Keybase proof

I hereby claim:

  • I am albacoretuna on github.
  • I am nickokapi (https://keybase.io/nickokapi) on keybase.
  • I have a public key ASDZMucH176p9UobeaTE64jOInC2OR6gbCEadt3ALnFddAo

To claim this, I am signing this object:

@albacoretuna
albacoretuna / port-forwarding-mac.md
Created November 13, 2019 12:11
Serving a create react app locally with backend api

Port forwarding on mac locally

Imagine you'd like to use account.exapmle.com from your local dev machine, but with the backend api.

  1. You need to change your hosts file:
sudo vim /etc/hosts

127.0.0.1 account.example.com