Skip to content

Instantly share code, notes, and snippets.

View Dangeranger's full-sized avatar
🦊
🍵 🐕 🚴

Joshua Burke Dangeranger

🦊
🍵 🐕 🚴
View GitHub Profile
@Dangeranger
Dangeranger / useful-git-commands.md
Last active August 29, 2015 14:21
Useful Git Commands

###Checkout a remote branch and set it to track the remote

This will keep your local branch in sync with the remote on push/pull/fetch

[email protected]:~$ git branch -vv

  joshes_branch   6a1e534 [origin/joshes_branch] added script tags to index.html
/* VT100 terminal reset (<ESC>c) */
console.log('\033c');
/* numbers comparations */
> '2' == 2
true
> '2' === 2
@mockdeep
mockdeep / bulk_updateable.rb
Created October 29, 2015 17:13
module to add ActiveRecord bulk update functionality for postgres
module BulkUpdatable
def bulk_update(objects, attribute)
return unless objects.any?
query = build_query_for(objects, attribute)
connection.execute(query)
end
private
@joepie91
joepie91 / vpn.md
Last active April 25, 2025 13:58
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
@chbrown
chbrown / _upgrade-pg9.4-to-pg9.5.md
Last active October 7, 2021 13:57
Upgrade PostgreSQL 9.4 to 9.5 on Mac OS X with Homebrew

First, check your current config (example output in homebrew.mxcl.postgresql.plist.xml lower down in this gist):

cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Most importantly, note the -D /usr/local/var/postgres argument.

Second, shut down your current PostgreSQL.

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@Dangeranger
Dangeranger / fix_borked_docker_machine.sh
Created February 3, 2016 21:28
fix borked docker machine
$ docker-machine ssh dev
Boot2Docker version 1.9.0, build master : 16e4a2a - Tue Nov 3 19:49:22 UTC 2015
Docker version 1.9.0, build 76d6bc9
$ sudo -i
$ rm -rf /var/lib/docker/network
# exit from the Docker host and then run
@alanpeabody
alanpeabody / A_README.md
Created July 17, 2016 15:33
Running a elixir dependency's migrations from parent app (in parent repo)

Goal

To pull in dependencies and have them run their migrations in the parent apps' repo.

Setup

MyChild - A mix application with ecto migrations, schemas, etc. MyParent - A phoenix application that wants to leverage the child application.

In this case MyParent has added MyChild as a mix dependency via github, eg:

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@Dangeranger
Dangeranger / orgmode_cheat_sheet.txt
Created September 13, 2016 13:08
OrgMode Cheat Sheet
From http://orgmode.org/orgcard.txt on 2016-09-13
================================================================================
Org-Mode Reference Card (for version 7.8.11)
================================================================================
================================================================================
Getting Started
@kevboutin
kevboutin / vindecoder.js
Last active September 4, 2024 13:25
Decode a VIN
/**
* VIN decoder.
*
* kevinboutin on 3/11/18.
*
* My VIN for testing is WBA3A5G59DNP26082 so use the following command to invoke:
* node vindecoder WBA3A5G59DNP26082
*
* Examples:
* KM8JM12D56U303366