Skip to content

Instantly share code, notes, and snippets.

View KaoruDev's full-sized avatar

Kaoru Kohashigawa KaoruDev

View GitHub Profile
@mattbell87
mattbell87 / iptables.md
Last active December 22, 2023 20:25
IPtables for routing over OpenVPN on Linux

Enable forwarding:

sysctl -w net.ipv4.ip_forward=1

Create this script eg sudo nano iptables.sh

eth=$1
proto=$2
@hex2010
hex2010 / start-screen-saver.sh
Created September 27, 2016 04:38
MacOS Sierra "start screen server" from command line, a way to Lock Screen
#!/bin/sh
/usr/bin/open -a /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app
## An alternate guide: https://gorails.com/deploy/ubuntu/14.04
So, you've built a cool Rails-based application, now you want to share it with others. You can go the Heroku route, they
have a free tier, its quick and painless, no mucking around in configuration files, just `git push` and you're done. But, what happens when you need more control? What happens when you build an application that uses a lot of functionality that only comes from paid add-ons on Heroku, but for a site that makes little-to-no revenue? In those situations, you can use a Virtual Private Server, or VPS for short.
#Why VPS?
VPS's are cheap, are relatively easy to setup (with some Linux know-how), and are much easier than having to deal directly with physical server hardware.
# Sign up for DigitalOcean
* Go here: https://www.digitalocean.com/
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active July 20, 2024 16:44
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@Integralist
Integralist / rules for good testing.md
Last active July 16, 2024 12:29
Sandi Metz advice for writing tests

Rules for good testing

Look at the following image...

...it shows an object being tested.

You can't see inside the object. All you can do is send it messages. This is an important point to make because we should be "testing the interface, and NOT the implementation" - doing so will allow us to change the implementation without causing our tests to break.

@webdesserts
webdesserts / Gulpfile.js
Last active April 3, 2023 08:16
Automatically reload your node.js app on file change with Gulp (https://github.com/wearefractal/gulp).
// NOTE: I previously suggested doing this through Grunt, but had plenty of problems with
// my set up. Grunt did some weird things with scope, and I ended up using nodemon. This
// setup is now using Gulp. It works exactly how I expect it to and is WAY more concise.
var gulp = require('gulp'),
spawn = require('child_process').spawn,
node;
/**
* $ gulp server
* description: launch the server. If there's a server already running, kill it.
@kylefox
kylefox / gist:4512777
Created January 11, 2013 18:15
If you want to use Xcode's FileMerge as your git mergetool, this is how you set it up.
# Tell system when Xcode utilities live:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
# Set "opendiff" as the default mergetool globally:
git config --global merge.tool opendiff
@MattWoelk
MattWoelk / workman.vim
Created March 25, 2011 23:45
workman keyboard layout for vim
"A blatant workman ripoff of bmx 007's beautiful colemak version called 'colqer' http://www.vim.org/scripts/script.php?script_id=2865 It makes vim so that you can insert and Ex mode in the workman keyboard layout, but can do the rest in qwerty.
"usage: put it in ~/.vim/plugin/ as workman.vim
"press \; in normal mode to activate/deactivate it.
"Keyboard is qwerty
" we want workman in insert mode
function IMapColemak()
if s:imap_colemak == 0
noremap! q q
noremap! w d