Skip to content

Instantly share code, notes, and snippets.

@fathergoose
fathergoose / bash-survival-guide.sh
Last active April 24, 2020 23:26
The bare essentials to shell navigation
# I have forked a much more complete cheat sheet, but is complete at the expense of being accessable
# You can find that bigger cheat sheet here https://gist.github.com/fathergoose/3fbc3b5f6c0ba3cbe367b18030b39aba
# things in <angleBrackts> are variables to be replaced for a spcific instance of the command
# Getting Help
man <command> # Read the man(ual) page entry for a given command (detailed help)
<command> --help # This *usually* prints a short summary of a command's options and arguments
# Directories
@fathergoose
fathergoose / bash-cheatsheet.sh
Created June 27, 2016 21:19 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@fathergoose
fathergoose / tap
Created June 5, 2016 00:27
A shell script to toggle tap to click on my Dell XPS13 L321X
#!/bin/bash
a=( $(xinput list-props "CyPS/2 Cypress Trackpad" | grep 'Tap Action') )
if [[ ${a[4]} == "2," ]]
then
xinput set-prop "CyPS/2 Cypress Trackpad" "Synaptics Tap Action" 0
echo Tap to click is now off
else
xinput set-prop "CyPS/2 Cypress Trackpad" "Synaptics Tap Action" 2, 3, 0, 0, 1, 3, 2
echo Tap to click is now on
#print skull and crossbones using UTF-8
echo -e "\xE2\x98\xA0"
# in one terminal
$ nc -l 1234
# then in irb
```ruby
require 'socket'
s = TCPSocket.new 'localhost', 1234
@fathergoose
fathergoose / keymap.cson
Created February 14, 2016 03:56
Atom Keybindings
# Your keymap
# ~/.atom/keymap.cson
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
require 'rspec'
class CoinChange
def least_coins(returned_money)
result = []
if returned_money >= 25
quantity_of_quarters = returned_money / 25
quantity_of_quarters.times do
result << 25
end