Skip to content

Instantly share code, notes, and snippets.

View samrocksc's full-sized avatar
:shipit:
LFG

Sam Clark samrocksc

:shipit:
LFG
View GitHub Profile
@rstacruz
rstacruz / README.md
Last active November 11, 2020 09:00
Prettier-eslint on Spacemacs

Setting up automatic Eslint formatting on Spacemacs

Note: This assumes that your project already has a working eslint setup!

Step 1: add prettier-eslint_d

prettier-eslint_d is a "daemon" versions of prettier and eslint. They are faster frontends to prettier and eslint, great for editors. Add it to your project via Yarn:

# prettier-eslint_d are replacements for these packages; if you have them,
const phonepad = [
[],
[],
['a', 'b', 'c'],
['d', 'e', 'f'],
['g', 'h', 'i'],
['j', 'k', 'l'],
['m', 'n', 'o'],
['p', 'q', 'r', 's'],
['t', 'u', 'v'],
@err0r500
err0r500 / main.go
Last active May 24, 2024 02:37
gin gonic with jwt from auth0 (and CORS enabled)
package main
import (
"github.com/auth0/go-jwt-middleware"
"github.com/dgrijalva/jwt-go"
"gopkg.in/gin-gonic/gin.v1"
)
func main() {
startServer()
@nvcexploder
nvcexploder / hapiExample.js
Last active July 25, 2021 05:39
basic hapi.js example highlighting HTTP methods and a few request parameters
/*
For this to run, ensure that `npm install hapi` has happened in your directory
setup whilst writing this:
iojs v. 1.0.5
hapi 8.2.0
*/
var Hapi = require('hapi');
@samrocksc
samrocksc / Open Closed for Business
Last active November 1, 2016 21:54
Uses javascript to determine hours of operation
//Establish Open/Closed Variable
var currentStatus = "closed";
//Establish Day of Week
var date = new Date();
function getWeekDay(date) {
var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
return days[date.getDay()]
}
var day = date.getDate()
@agendor
agendor / hapijs-rest-api-tutorial.md
Last active August 31, 2021 08:31
A practical introduction to building a RESTful API with the hapi.js server framework for Node.js
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@balupton
balupton / README.md
Last active October 13, 2015 08:18
DocPad: Localising Dates
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 25, 2024 07:26
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000