Skip to content

Instantly share code, notes, and snippets.

View neuthral's full-sized avatar
🦌
bubbling

neuthral neuthral

🦌
bubbling
View GitHub Profile
@neuthral
neuthral / tmux-cheatsheet.markdown
Created January 9, 2017 17:09 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@neuthral
neuthral / gist:73621c556db637e604ec71778a9be1d5
Created January 27, 2017 21:26
Clutch - Unto The Breach Tab
Hi - my first tab so go easy on me. Pretty easy song to play. Just listen to it
to get the rhythm.
Standard Tuning
Intro
E||----------------------------------------------------------------------||
B||----------------------------------------------------------------------||
G||----------------------------------------------------------------------||
<body>
DALAMAN.FI - kuitti tilaukselle #{{ $data['orderNum'] }} {{ $data['date'] }}
{{ $data['name'] }}
{{ $data['address'] }}
{{ $data['delivery'] }}
<br>
@foreach($data['products'] as $product)
<br>{{ $product }}
board:{ // index for all threads
posts: [
{0: "hash"},
{1: "hash"},
{2: "hash"},
]
}
post:{
name: $timestamp,
@neuthral
neuthral / phaser_camera_zoom.js
Created June 6, 2017 19:56
// Phaser 2.0.4 camera zoom test (with camera bounds checking) // Use cursors to move the camera, Q to zoom in, A to zoom out
// Phaser 2.0.4 camera zoom test (with camera bounds checking)
// Use cursors to move the camera, Q to zoom in, A to zoom out
var preload = function(game) {
game.time.advancedTiming = true;
}
var worldScale = 1;
var player;
var bgGroup;
@neuthral
neuthral / app.js
Created August 31, 2017 18:47 — forked from bingeboy/app.js
Upload and display image with NodeJS and Express.
/*
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, common = require('./routes/common')
, fs = require('fs')
, http = require('http')
, util = require('util')
@neuthral
neuthral / gist:f70718f58c53f99063c8267d361c5611
Created August 31, 2017 19:54
Angular2 upload files to nodejs
# Angular2 upload files to nodejs
When I build web applications, my least favorite part is always in the realm of file uploads. They are often complicated to do and take a lot of time. Pretty much every web application lately, regardless of what it is, requires file uploads, even if it is just to upload a profile picture.
Since I’m all about Angular 2 lately, I figured it would be great to show how to upload images (or any file) to a back-end. In this particular example I’m using Node.js.
Some things to be clear about up front. At the time of writing this, Angular 2 is in beta version 3\. The Angular team claims that no breaking changes will be introduced in the betas, but I figured it is best we lay it out on the table that it could be a possibility. I also want to be clear that a lot of this code was co-produced with a friend of mine, Todd Greenstein. This tutorial will be broken up into two parts: File uploading via the Angular 2 front-end File receiving via the Node.js back-end We won’t be doing anythi
--- hash
--- second
@neuthral
neuthral / hosts_google
Created September 21, 2017 15:53
block google servers in hosts file
# ALWAYS make sure "127.0.0.1 localhost" is the first line in your /hosts file
# or your system or browser may malfunction!
# See https://en.wikipedia.org/wiki/Hosts_file to find the standard locations
# of the HOSTS file for your particular OS. In Linux (and probably BSD), it's
# usually under /etc/hosts
# Yes, I know there are some redundant entries in this block--you can grep it
# and remove them yourself if it really matters. I'm too lazy to do it myself.
@neuthral
neuthral / bash_web_server.sh
Created November 11, 2018 14:06
bash web server
:;while [ $? -eq 0 ];do nc -vlp 8080 -c'(r=read;e=echo;$r a b c;z=$r;while [ ${#z} -gt 2 ];do $r z;done;f=`$e $b|sed 's/[^a-z0-9_.-]//gi'`;h="HTTP/1.0";o="$h 200 OK\r\n";c="Content";if [ -z $f ];then($e $o;ls|(while $r n;do if [ -f "$n" ]; then $e "<a href=\"/$n\">`ls -gh $n`</a><br>";fi;done););elif [ -f $f ];then $e "$o$c-Type: `file -ib $f`\n$c-Length: `stat -c%s $f`";$e;cat $f;else $e -e "$h 404 Not Found\n\n404\n";fi)';done