Skip to content

Instantly share code, notes, and snippets.

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
# 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 ->
@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.
#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 / 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
@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 / 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
hey, this is content too
@fathergoose
fathergoose / unix_forgetables.md
Last active August 7, 2017 21:46
Things I always forget but always need too

Use awk to grab some word(s)

It's really all I ever want to do with awk

$ echo "my name is Al" | awk '{print $4 " " $3 " " $2}'
  Al is name

Install a .deb package from cli

$ sudo dpkg -i 
@fathergoose
fathergoose / pre-commit.sh
Created July 6, 2017 03:28
Check for debugger statements before commiting your code.
#!/bin/sh
#
# Check for debugger statements before commiting your code.
#
# Nodejs uses 'debugger' as a keyword statement to trigger a
# breakpoint. There's literally no reason to commit such a thing
echo "Running debugger check..."
RES=`git grep -n 'debugger'`