This is a demonstration of using Ruby and the WiringPi Gem to pulse an LED connected to a GPIO pin in a manner similar to the sleep indicator on a MacBook.
A video of the effect can be found here: http://www.youtube.com/watch?v=NCUMXK7qf-c
| package main | |
| import ( | |
| "fmt" | |
| _ "github.com/go-sql-driver/mysql" | |
| "github.com/jmoiron/sqlx" | |
| ) | |
| type Hoge struct { |
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
| import code; code.interact(local=dict(globals(), **locals())) |
| s=IO.read(ARGV[0]);File.write(ARGV[0], s.gsub(";","\u037E")) |
| // Make our app module, its easier to do this in raw javascript | |
| // and then put the rest of our app content (controllers etc) | |
| // in their own coffeescript files. | |
| // | |
| // Your ng-app should include this module name, eg: <html ng-app="TodoApp"> | |
| angular.module('TodoApp', []); |
This is a demonstration of using Ruby and the WiringPi Gem to pulse an LED connected to a GPIO pin in a manner similar to the sleep indicator on a MacBook.
A video of the effect can be found here: http://www.youtube.com/watch?v=NCUMXK7qf-c
| <!doctype html> | |
| <title>Site Maintenance</title> | |
| <style> | |
| body { text-align: center; padding: 150px; } | |
| h1 { font-size: 50px; } | |
| body { font: 20px Helvetica, sans-serif; color: #333; } | |
| article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
| a { color: #dc8100; text-decoration: none; } | |
| a:hover { color: #333; text-decoration: none; } | |
| </style> |
| def output name=((default=true); "caius") | |
| puts "name: #{name.inspect}" | |
| puts "default: #{default.inspect}" | |
| end | |
| output | |
| # >> name: "caius" | |
| # >> default: true | |
| output "avdi" |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <title>Object#tap in JavaScript</title> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script> | |
| <script type="text/javascript" src="http://sugarjs.com/javascripts/sugar-0.9.5.min.js"></script> | |
| <script type="text/javascript"> | |
| jQuery.noConflict(); | |
| (function($) { |
| # useful nginx configuration for reverse proxy with Apache | |
| # edit lines 8, 11, and 30 | |
| # taken from: http://syslog.tv/2010/01/11/debian-apache-2-nginx-wordpress-mu/ | |
| # edits by jakebellacera (http://github.com/jakebellacera && http://jakebellacera.com) | |
| server { | |
| listen 80; | |
| server_name domain.com *.domain.com; # edit this to your domain |