This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# LIBRARY FOR CONTROL PARALLAX 16x2 SERIAL LCD DISPLAY ON A RASBERRY PI | |
# | |
# Wiring Diagram | |
# PI LCD | |
# **************************** | |
# pin 8 (TX) -------> RX | |
# pin 6 (GND) -------> GND | |
# pin 2 (5V) -------> 5V | |
# | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RUBY LIBRARY FOR SERIAL COMM RS-323 TO 4X20 | |
# LCD COMPATIBLE WITH THE NEW HAVEN DISPLAY COMMANDS | |
# | |
# LCD MODEL# NHD-0420D3Z-NSW-BBW | |
# | |
# SPEC SHEET LOCATED: | |
# http://www.newhavendisplay.com/specs/NHD-0420D3Z-NSW-BBW.pdf | |
# | |
# HOOK UP PIN 1 TO TX ON RASBERRY PI | |
# PIN 2 TO GND |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# REMOTE CONTROL | |
# pianobar can be controlled through a fifo. You have to create it | |
# yourself by executing | |
# mkfifo ~/.config/pianobar/ctl | |
# Adjust the path if you set up a $XDG_CONFIG_HOME. Afterwards you can | |
# write commands directly into the fifo. Example (next song): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'socket' | |
require "/home/pi/projects/lcd/lcd" | |
def local_ip(target) | |
# turn off reverse DNS resolution | |
bdns, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true | |
UDPSocket.open do |s| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Steps to get Raspberry Pi running with Mopidy and Spotify | |
1. Raspian Wheezy Installation | |
2. Install Python tools following these instructions | |
(had to run most of it as sudo): | |
http://raspberry.io/wiki/how-to-get-python-on-your-raspberrypi/ | |
3. Install Spotify libspotify | |
https://developer.spotify.com/technologies/libspotify/#download | |
4. Install Mopidy following these directions: | |
http://docs.mopidy.com/en/latest/installation/raspberrypi/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ -e ~/.rvm/bin/rvm-prompt ]; then | |
J_CURRENT_RUBY_="%{$fg[white]%}[%{$fg[green]%}\$(~/.rvm/bin/rvm-prompt i v)%{$fg[white]%}]%{$reset_color%}" | |
else | |
if which rbenv &> /dev/null; then | |
J_CURRENT_RUBY_="%{$fg[white]%}[%{fg[red]%}\$(rbenv version | sed -e 's/ (set.*$//')%{$fg[white]%}]%{$reset_color%}" | |
fi | |
fi | |
function get_pwd() { | |
echo "${PWD/$HOME/~}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import QuartzCore | |
class ViewController: UIViewController { | |
var eView: UIVisualEffectView? | |
@IBAction func blurOut(sender: UIVisualEffectView) { | |
//eView?.removeFromSuperview() | |
var removeTransition = CATransition() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Presenting Controller | |
func popOver() { | |
var popoverContent = self.storyboard.instantiateViewControllerWithIdentifier("popOver") as UIViewController | |
var nav = UINavigationController(rootViewController: popoverContent) | |
nav.modalPresentationStyle = UIModalPresentationStyle.Popover | |
var popover = nav.popoverPresentationController as UIPopoverPresentationController | |
popoverContent.preferredContentSize = CGSizeMake(500,600); | |
popover.delegate = self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UIView.transitionWithView(self.view, duration: 0.5, options: UIViewAnimationOptions.TransitionNone, | |
animations: {self.view.addSubview(effectView)}, completion: nil) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Playground - noun: a place where people can play | |
import UIKit | |
class BaseUIDefaults { | |
class var sharedInstance : BaseUIDefaults { | |
struct Static { | |
static let instance : BaseUIDefaults = BaseUIDefaults() | |
} |
OlderNewer