Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Sweeney 8bitDesigner

  • Fullscreen, Inc.
  • Los Angeles
View GitHub Profile
@jamesmacfie
jamesmacfie / README.md
Created Oct 22, 2019
iTerm 2 - script to change theme depending on Mac OS dark mode
View README.md

How to use

In iTerm2, in the menu bar go to Scripts > Manage > New Python Script

Select Basic. Select Long-Running Daemon

Give the script a decent name (I chose auto_dark_mode.py)

Save and open the script in your editor of choice.

@skout23
skout23 / logs_insights_queries.txt
Created Feb 11, 2019
Scratch Pad ideas for Cloudtrail queries using AWS Cloudwatch Logs Insights
View logs_insights_queries.txt
```
filter eventName="ConsoleLogin"
| stats count(*) as eventCount by userIdentity.userName, sourceIPAddress
| sort eventCount desc
filter not sourceIPAddress =~ /^(?i)123.123.123.123/ and userIdentity.userName =~/^(?i)\w/
| stats count(*) as eventCount by eventName, userIdentity.userName, sourceIPAddress
| sort eventCount desc
filter eventName="ConsoleLogin"
View ruby_engineer_task.md

Data integrity is so important. We need your help to make sure we've got it.

You've received two different sets of data, each claiming to be the reliable source of truth. Write a ruby command line tool that can parse the two sets of data and output any discrepancies.

The data sits in two CSV files, each with three columns:

Account Email, YouTube Channel, Subscriber Count

You can assume the account emails are the same between files and reliable.

View gist:abbcb14fd1c539f9586d
#!/bin/sh
set -e
apt-get update -q
echo iptables-persistent iptables-persistent/autosave_v4 boolean true | debconf-set-selections
echo iptables-persistent iptables-persistent/autosave_v6 boolean true | debconf-set-selections
apt-get install -qy openvpn curl iptables-persistent
cd /etc/openvpn
[ -f dh.pem ] || openssl dhparam -out dh.pem 2048
View awesome.css
* {
box-shadow: inset 0 0 0 10px #FF009A;
width: auto;
color: #FFF;
background: rgba(0, 0, 0, 0) url(http://herogamesworld.com/images/my%20little%20pony%20games.jpg) repeat;
}
@8bitDesigner
8bitDesigner / .powrc
Last active Dec 28, 2015 — forked from nbibler/gist:5307941
Everything you need to use RVM _sanely_.
View .powrc
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
@8bitDesigner
8bitDesigner / _usage.js
Last active Dec 21, 2015
Properly inheriting objects in Javasacript
View _usage.js
function Child() {
Parent.call(this);
}
extends(Child, Parent);
@8bitDesigner
8bitDesigner / 1.md
Last active Nov 17, 2021
Git post-merge hook which, when you run `git merge` or `git pull` will then `bundle` if the project's Gemfile changed, or `npm install` if the project's package.json changed.Inspired and based off of https://gist.github.com/bumi/5706550
View 1.md

Make bundleing and npm installing easy

This repo has some handy handy hooks to run bundle or npm install whenever you:

  • git checkout a new branch with a different Gemfile or package.json
  • git pull a change to Gemfile or package.json

How can I has this!!?

  1. git clone https://gist.github.com/5869846.git hooks && cd hooks && chmod +x install
@nbibler
nbibler / gist:5307941
Last active Oct 7, 2021
A .powrc file which works with RVM's .rvmrc or .ruby-version (+ .ruby-gemset) configuration files.
View gist:5307941
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
fi
if [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
fi
@turtlesoupy
turtlesoupy / minimal.coffee
Created Sep 21, 2012
Minimal example of a gracefully restarting node.js process
View minimal.coffee
express = require 'express'
gracefullyExiting = false
app = express.createServer()
app.use (req, res, next) ->
return next() unless gracefullyExiting
res.setHeader "Connection", "close"
res.send 502, "Server is in the process of restarting."