Skip to content

Instantly share code, notes, and snippets.

View thejmazz's full-sized avatar

Julian Mazzitelli thejmazz

View GitHub Profile
@thejmazz
thejmazz / app.js
Created September 20, 2016 17:58
mapbox-gl-js + webpack issues
// thanks sleepycat https://github.com/sleepycat/mapboxgl-webpack-example
import mapboxgl from 'mapbox-gl'
mapboxgl.accessToken = 'pk.eyJ1IjoibWlrZXdpbGxpYW1zb24iLCJhIjoibzRCYUlGSSJ9.QGvlt6Opm5futGhE5i-1kw';
var map = new mapboxgl.Map({
container: 'map', // container id
style: 'mapbox://styles/mapbox/streets-v8', //stylesheet location
center: [-74.50, 40], // starting position
zoom: 9 // starting zoom
@thejmazz
thejmazz / logs-per-hour.sh
Created September 14, 2017 18:59
Get mb/days of logfile for a docker container
#!/usr/bin/env sh
# Usage: call with docker container name, requires stat
# E.g. sudo ./logs-per-hour project_service_1
id=$(docker inspect $1 --format "{{ .ID }}")
started_date=$(docker inspect $id --format "{{ .Created}}")
started=$(date +%s -d ${started_date})
now=$(date +%s)
@thejmazz
thejmazz / package.json
Created August 1, 2017 04:32
ES2015 + glsl files + inline GLSL, with glslify on webpack 2
{
"scripts": {
"start": "webpack-dev-server",
"build": "NODE_ENV=production webpack"
},
"devDependencies": {
"babel-core": "^6.18.2",
"babel-loader": "^6.2.8",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-glslify": "^2.0.0",
@thejmazz
thejmazz / xXh4ckerXx.md
Last active June 29, 2017 20:26
Misc command line things that are good to know

tmux

sed (Stream Editor)

  • sed s/-/\ /g substitute globally (- to spaces in this case)

users and groups

  • list all users: cut -d: -f1 /etc/passwd OR compgen -u
  • list all groups: compgen -g
@thejmazz
thejmazz / README.md
Last active May 9, 2017 19:53
Example showing chrome debugger and express server with nodemon duplicated logging

screen shot 2017-05-09 at 3 44 42 pm screen shot 2017-05-09 at 3 45 11 pm screen shot 2017-05-09 at 3 45 22 pm

'use strict'
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
const whsAliases = require('whs/tools/alias.js')
const isProd = process.env.NODE_ENV === 'production'
@thejmazz
thejmazz / headless-gl-simple-clear-render.js
Last active March 13, 2017 13:51
Simple clear render with headless gl
'use strict'
const width = 512
const height = 512
const fs = require('fs')
const { PNG } = require('pngjs')
const gl = require('gl')(width, height, { preserveDrawingBuffer: true })
const regl = require('regl')(gl)
@thejmazz
thejmazz / drone-docker-compose.yml
Last active December 19, 2016 16:49
docker-compose for drone and nginx reverse proxy
version: '2'
services:
drone:
image: drone/drone:0.4
restart: always
env_file: drone/dronerc
privileged: true # allows us to run a docker daemon
volumes:
- data:/var/lib/drone
- /var/run/docker.sock:/var/run/docker.sock
@thejmazz
thejmazz / PointsFromGeometry.js
Created December 17, 2016 22:08
WHS Points Component
class Shell extends WHS.Component {
static instructions = {
position: [ 'x', 'y', 'z' ]
}
constructor(params = {}) {
super(params, WHS.Component.defaults, Shell.instructions)
const { radius, detail } = params.geometry