Skip to content

Instantly share code, notes, and snippets.

View blakek's full-sized avatar
☦️

Blake Knight blakek

☦️
View GitHub Profile
@BigAppa
BigAppa / osx_setup.md
Created July 29, 2020 02:30 — forked from millermedeiros/osx_setup.md
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@laknath
laknath / ipset_generate.sh
Created May 15, 2019 10:41 — forked from csrutil/ipset_generate.sh
IPSET - fetch certain countries ip blocks for iptables DROP
#!/bin/bash
country_block=(china bangladesh cambodia hongkong india iran iraq jordan korea kuwait malysia morocco oman pakistan qatar saudi singapore sudan thailand taiwan emirates vietnam turkey)
@mattradford
mattradford / pull-wpe.sh
Created April 27, 2018 15:49
Pull a WP Engine install via SSH. File and DB.
    #!/bin/bash
    # Pull an install's files and DB from WP Engine
    # Variables
    lpath='app/public/'
    rpath='~/sites/'$install
    #User input
    read -p 'Repo to clone (blank if none): ' repo
    read -p 'Install to pull: ' install
    read -r -p 'Include uploads? (y/N) ' response
    read -p 'Local MySQL port: ' port
@kirilloid
kirilloid / type.js
Last active July 29, 2022 19:42
getType
function getType (value) {
let type = typeof value;
if (type === 'object') {
return value ? Object.prototype.toString.call(value).slice(8, -1) : 'null';
}
return type;
}
[NaN, 0, 1, Infinity, // numbers
null, undefined, false, 'str', // other primitives
@blakek
blakek / bash_aliases.sh
Last active January 31, 2020 18:09
My dotfile backup
##
# Standarize system commands
##
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -lhF'
alias grep='grep --colour=auto'
alias egrep='egrep --colour=auto'
alias fgrep='fgrep --colour=auto'
@stonehippo
stonehippo / app-prototyping-tools.md
Last active November 15, 2016 22:06
A collection of app prototyping tools that I find interesting

#App Prototyping Tools

Origami is a plugin for Apple's Quartz Composer visual development tool. Developed by Facebook for prototyping interaction design in mobile apps, Origami is well suited to that task.

Pros

  • Codeless, patches and wires interface
  • Create complex and very refined interaction prototypes quickly
@korayguclu
korayguclu / nginx.conf
Last active August 29, 2015 14:06 — forked from thoop/nginx.conf
nginx.conf from prerender.io to prerender angularjs for seo purposes
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name and in the rewrite rule) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;
@branneman
branneman / better-nodejs-require-paths.md
Last active June 29, 2024 16:00
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

@jtdp
jtdp / gist:5443498
Last active May 23, 2024 16:23
Revert file permission changes in local git repository.. Very useful when you change permissions due to working on a samba share. Lifted from: http://stackoverflow.com/questions/2517339/git-how-to-recover-the-file-permissions-git-thinks-the-file-should-be
git diff -p \
| grep -E '^(diff|old mode|new mode)' \
| sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' \
| git apply
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active June 13, 2024 02:39
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx