This file contains hidden or 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 python | |
| # Quick and dirty demonstration of CVE-2014-0160 by | |
| # Jared Stafford (jspenguin@jspenguin.org) | |
| # Modified so that it finds cookies | |
| import sys | |
| import struct | |
| import socket | |
| import time | |
| import select |
This file contains hidden or 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
| require 'facter' | |
| Facter.add(:current_users) do | |
| setcode do | |
| output = Facter::Util::Resolution.exec(%q{/usr/bin/w -h | grep console | /usr/bin/awk -F" " '{ print $1 }'}) | |
| output.gsub(/\n/,'::').split('::').uniq.join(',') # Convert the individual line output to a comma list w/ unique values | |
| end | |
| end |
This file contains hidden or 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
| use_bpm 120 | |
| use_synth :fm | |
| $root = 52 | |
| $key = :major | |
| define :metro do | |
| cue :tick | |
| sleep 1 | |
| end |
This file contains hidden or 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 | |
| class JingleBells | |
| def initialize | |
| @jingle_count = 0 | |
| end | |
| def can_jingle? | |
| @jingle_count < 2 | |
| end |
This file contains hidden or 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 'minitest/autorun' | |
| Hash.class_eval do | |
| def deep_fetch(*keys, default: nil) | |
| keys.reduce(self) do |memo, key| | |
| memo.fetch(key) | |
| end | |
| rescue KeyError |
This file contains hidden or 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
| <img id="webcam" src="https://www.webcam-4insiders.com/current/medium/14082-Webcam-Leysin-Wetter.jpg" alt="LAS Gym Construction"> | |
| <script type="text/javascript"> | |
| var refreshImage = function() { | |
| var refreshInterval = 600000; // This is time in milliseconds; 60,000 = 10 minutes | |
| var source = "https://www.webcam-4insiders.com/current/medium/14082-Webcam-Leysin-Wetter.jpg?time=" + new Date().getTime(); | |
| document.getElementById('webcam').src = source; | |
| setTimeout(refreshImage, 600000); | |
| } | |
| refreshImage(); | |
| </script> |
This file contains hidden or 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
| comment do | |
| # transcribed from the MML notation here: http://www.mmlshare.com/tracks/view/403 | |
| # | |
| # Sonic Pi currently has a size limit of about 9k which is a known issue (#102). | |
| # I've kept the comments up here to get around that as comment blocks don't get | |
| # sent to the interpreter. Some of the layout here is an exercise in reducing bytes. | |
| # I'm using Ruby's stabby lambda syntax ( -> { ... } ) in case you want to google it :) | |
| # | |
| # THIS HAS ONLY BEEN TESTED ON A MAC - on an RaspberryPi you might want to change it to | |
| # use_bpm 60 |
This file contains hidden or 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
| # Let it Go - Pi Version | |
| use_bpm 34 | |
| use_synth :pretty_bell | |
| quaver = 0.125 #Eight note | |
| crotchet = 0.25 #Quarter note | |
| minim = 0.5 #Half note | |
| semibreve = 1 #Whole note | |
| in_thread(name: :rh) {rightHand} |
This file contains hidden or 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
| # My attempt to recreate the OSCon Keynote "The Concert Programmer" | |
| # by Andrew Sorensen using Sonic-Pi. | |
| use_bpm 120 | |
| use_synth :fm | |
| $root = 52 | |
| $key = :major | |
| live_loop :metro do | |
| sleep 1 |
OlderNewer