Skip to content

Instantly share code, notes, and snippets.

View hhsnopek's full-sized avatar
Working from home

Henry Snopek hhsnopek

Working from home
View GitHub Profile
@abv
abv / foodtruck.1m.sh
Last active July 26, 2018 17:15
DUMBO food truck cam in OS X menu bar (For BitBar)
#!/bin/bash
TIMESTAMP=$(date +"%s")
IMAGE=$(curl -s "https://nexusapi-us1.camera.home.nest.com/get_image?uuid=5a6a099c3d894d0284560626c7944d50&width=400&t=$TIMESTAMP" | base64)
cat << EOF
DUMBO 🚚
---
| href=https://www.datalot.com/dumbo-food-truck-cam/ image=$IMAGE
EOF
@enricofoltran
enricofoltran / main.go
Last active April 1, 2024 00:17
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@jescalan
jescalan / index.md
Last active August 16, 2016 20:27
Differences between jade and the spike-standards stack

Spike v0.11.0 Migration Guide

In this release of spike, we switch posthtml for reshape. Reshape is a complete rewrite of posthtml by the static-dev team with several significant differences:

  • It returns a function by default, so that its results can be used as client-side templates
  • It has a much more clear and robust error reporting system, reporting errors that include the line/col in the original source, and exposing a code snippet to show where it came from
  • It has more clearly written documentation, more thorough tests, consistent code style, and 100% coverage on all core modules

However, as a consequence of this move, the jade plugin is no longer available. The jade plugin was always a hack, and had several crippling caveats. In addition, jade does not fit well with reshape's philosophy of breaking functionality down into small modules. As such, we have replaced ja

# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/
# core
brew install coreutils
# key commands
brew install binutils
brew install diffutils
brew install ed --default-names
brew install findutils --with-default-names
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@chrishoage
chrishoage / kwm.1s.sh
Last active February 9, 2016 20:11
kwm BitBar script
#!/bin/bash
kwmc=$HOME/bin/kwmc
currentFocus=$($kwmc read focus)
currentMouse=$($kwmc read mouse-follows)
tag=$($kwmc read tag)
if [ "$1" = 'quit' ]; then
killall kwm
@hhsnopek
hhsnopek / git-commit-stuff.md
Last active April 19, 2016 18:26
Git commit stuff

Branch Names

  • initials.feature ex: hs.update-docs

Commit Emojis

  • 💄 when improving the format/structure of the code
  • 🚀 when improving performance
  • ✏️ when writing docs
  • 💡 new idea
  • 🚧 work in progress
  • ➕ when adding feature
function SaferHTML(templateData) {
var s = templateData[0];
for (var i = 1; i < arguments.length; i++) {
var arg = String(arguments[i]);
// Escape special characters in the substitution.
s += arg.replace(/&/g, "&amp;")
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;");

Writing template strings in Markdown

With template strings coming to ES6, the backtick (`) means something in Markdown and in JavaScript. If you write this:

To display a message, write `alert(`hello world!`)`.

it'll render like this:

To display a message, write alert(hello world!).

@chrismdp
chrismdp / s3.sh
Last active March 5, 2024 12:57
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1