Skip to content

Instantly share code, notes, and snippets.

:octocat:
Writing YAML + HCL and googling errors

Julien Bisconti veggiemonk

:octocat:
Writing YAML + HCL and googling errors
Block or report user

Report or block veggiemonk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View gist:696508a6009a25e52c81
# from hyphen/dash to camelCase
rename 's/-(\w)/\U$1/g' list-of-files
# from camelCase to hyphen/dash
sed -e 's/\([A-Z]\)/-\L\1/g' -e 's/^-//' <<< "MyDirectoryFileLine"
View notepad.html
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/javascript");</script>
<!--
For other language: Instead of `ace/mode/ruby`, Use
Markdown -> `ace/mode/markdown`
Python -> `ace/mode/python`
C/C++ -> `ace/mode/c_cpp`
Javscript -> `ace/mode/javascript`
Java -> `ace/mode/java`
Scala- -> `ace/mode/scala`
@veggiemonk
veggiemonk / cb-in
Last active Aug 29, 2015 — forked from Gen2ly/cb-in
Copy file or pipe to Xorg clipboard
View cb-in
#!/bin/bash
# Copy file or pipe to Xorg clipboard
# Required program(s)
req_progs=(xclip)
for p in ${req_progs[@]}; do
hash "$p" 2>&- || \
{ echo >&2 " Required program \"$p\" not installed."; exit 1; }
done
@veggiemonk
veggiemonk / cb-out
Last active Aug 29, 2015 — forked from Gen2ly/cb-out
Paste contents of Xorg clipboard to a file from the command line
View cb-out
#!/bin/bash
# Paste contents of Xorg clipboard to a file from the command line
filename=$@
pasteinfo="clipboard contents"
# Display usage if no parameters given
if [[ -z "$@" ]]; then
echo " ${0##*/} <filename> - paste contents of context-menu clipboard to file"
exit
@veggiemonk
veggiemonk / nginxproxy.md
Last active Aug 29, 2015 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?
View nginxproxy.md

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@veggiemonk
veggiemonk / Makefile
Created Oct 5, 2015 — forked from lox/Makefile
Replaced Grunt/Gulp with a Makefile
View Makefile
SASSC = sass --style compact
COMPSDIR = resources/assets/components
SASSDIR = resources/assets/css
JSDIR = resources/assets/js
DISTDIR = web/dist
CSSDIR = $(DISTDIR)/css
SASSINC = $(SASSDIR) \
$(COMPSDIR)/asimov/src/scss \
$(COMPSDIR)/asimov-contests/src/scss \
$(COMPSDIR)/asimovicons/src/scss
@veggiemonk
veggiemonk / functions.js
Created Nov 11, 2015 — forked from gilbert/functions.js
JavaScript Function Extensions
View functions.js
// Partially apply arguments to a function. Useful for binding
// specific data to an event handler.
// Example:
//
// var add = function (x,y) { return x + y }
// var add5 = add.papp(5)
// add5(7) //=> 11
//
Function.prototype.papp = function () {
var slice = Array.prototype.slice
You can’t perform that action at this time.