Skip to content

Instantly share code, notes, and snippets.

View matti's full-sized avatar
🎯
Focusing

Matti Paksula matti

🎯
Focusing
View GitHub Profile
puts "lol"
abba = func(x)
@matti
matti / xcode-nuke-uninstall.rb
Created November 1, 2014 16:57
completely remove all xcode files
#!/usr/bin/env ruby
cancer_in_home = [
"Library/Developer",
"Library/Preferences/com.apple.dt.*",
"Library/Caches/com.apple.dt.*",
'Library/Application\ Support/Xcode'
]
cancer_in_root = [
@matti
matti / beddit.rb
Last active August 29, 2015 14:10
beddit api starter
require "httparty"
ENDPOINT = "https://cloudapi.beddit.com"
login_options = {
"grant_type" => "password",
"username" => "TODO",
"password" => "TODO"
}
@matti
matti / e
Created May 12, 2015 06:40
e
#!/usr/bin/env sh
/Applications/Atom.app/Contents/MacOS/Atom $@ &>/dev/null &
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
@matti
matti / send_authorized_keys.expect
Created July 10, 2015 16:08
expect send authorized_keys before
#!/usr/bin/expect -f
# NOTE: ..and then I discovered ssh-copy-id && sshpass: sshpass -p raspbian ssh-copy-id -i ~/.ssh/id_rsa.pub -p 22 root@pi
set rpi_host [lindex $argv 0];
set rpi_host_port [lindex $argv 1];
set authorized_key [lindex $argv 2];
spawn scp -P $rpi_host_port -o PubkeyAuthentication=no -r $authorized_key root@$rpi_host:authorized_keys
expect "assword:"
\documentclass[11pt]{report}
\begin{document}
\title{Title of this document}
\maketitle
\tableofcontents
\abstract{This is the abstract}
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the Uno and
Leonardo, it is attached to digital pin 13. If you're unsure what
pin the on-board LED is connected to on your Arduino model, check
the documentation at http://www.arduino.cc
This example code is in the public domain.
/*
Arduino Starter Kit example
Project 7 - Keyboard
This sketch is written to accompany Project 7 in the
Arduino Starter Kit
Parts required:
two 10 kilohm resistors
1 Megohm resistor
#!/usr/bin/env sh
brew uninstall postgres
launchctl remove homebrew.mxcl.postgresql
rm /Users/mpa/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
rm -rf /usr/local/var/postgres
brew install postgres
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist