Skip to content

Instantly share code, notes, and snippets.

@gld1982ltd
gld1982ltd / static_server.js
Created January 19, 2016 13:37 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@gld1982ltd
gld1982ltd / npm-boilerplate-package.json
Created January 16, 2016 07:19 — forked from iksi/npm-boilerplate-package.json
npm boilerplate package for web projects
{
"name": "project",
"private": true,
"scripts": {
"build:css": "postcss --use postcss-import --use autoprefixer --autoprefixer.browsers 'last 3 versions' --use cssnano --use postcss-cssnext --output assets/css/full.css assets/css/src/index.css",
"watch:css": "postcss --watch --use postcss-import --use autoprefixer --autoprefixer.browsers 'last 3 versions' --use cssnano --use postcss-cssnext --output assets/css/full.css assets/css/src/index.css",
"build:js": "uglifyjs assets/js/src/init.js --no-mangle --compress sequences=true,dead_code=true,conditionals=true,booleans=true,unused=true,if_return=true,join_vars=true,drop_console=true --output assets/js/full.js",
"watch:js": "watch 'uglifyjs assets/js/src/init.js --no-mangle --source-map full.js.map --output assets/js/full.js' assets/js/src"
},
"devDependencies": {
@gld1982ltd
gld1982ltd / style.js
Created January 16, 2016 07:18 — forked from MichalZalecki/style.js
Script transpiling CSS with cssnext
const cssnext = require("cssnext");
const fs = require("fs");
const watch = require("node-watch");
const program = require("commander");
program
.version("0.0.1")
.option("-s, --source [path]", "Source file")
.option("-d, --destination [path]", "Destination file")
.option("-w, --watch [path]", "Watch directory")
var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
}
@gld1982ltd
gld1982ltd / daltonmaag.com
Created January 6, 2016 16:02 — forked from samdaltonmaag/daltonmaag.com
server setup
## /etc/nginx/sites-available/daltonmaag.com
# create an upstream for the node server
upstream node_app {
server 127.0.0.1:3000;
}
server {
listen 0.0.0.0:80;
server_name testing.daltonmaag.com testweb;

Keybase proof

I hereby claim:

  • I am gld1982ltd on github.
  • I am gld1982ltd (https://keybase.io/gld1982ltd) on keybase.
  • I have a public key whose fingerprint is E883 3184 05EA 1FEB A3B7 3668 55C4 D463 82BB 099C

To claim this, I am signing this object:

#!/bin/bash
#
# Provision for Vagrant box ArchLinux
#
# Insert to Vagrantfile:
# config.vm.provision "shell", path: "https://gist.github.com/smaknsk/8165875/raw"
#
#
# Run nginx, httpd, php-fpm as user:
@gld1982ltd
gld1982ltd / nginx.conf
Created December 31, 2015 23:07 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@gld1982ltd
gld1982ltd / bobross.css
Created December 26, 2015 02:33 — forked from thomaspark/bobross.css
Bob Ross’ color palette in CSS
.sap-green {
background-color: #0A3410;
}
.sap-green-text {
color: #0A3410;
}
.sap-green-border {
border-color: #0A3410;
}
@gld1982ltd
gld1982ltd / merge-css.js
Created December 10, 2015 17:12 — forked from pritambaral/merge-css.js
Merge Duplicate CSS rules; detected by selector
#!/usr/bin/env node
if (process.argv.length < 3) {
console.error('Usage:', process.argv.join(' '), '/path/to/file.css');
process.exit(1);
}
file = process.argv[2];
var fs = require('fs');