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
| #!/bin/sh | |
| isFullyCharged=`ioreg -n AppleSmartBattery | grep FullyCharged | awk '{ print $5 }'` | |
| timeLeft=`ioreg -n AppleSmartBattery | grep TimeRemaining | awk '{ print $5 }'` | |
| isCharging=`ioreg -n AppleSmartBattery | grep IsCharging | awk '{ print $5 }'` | |
| if [ $isFullyCharged = "Yes" ] ; then | |
| output="Full Charge" | |
| else | |
| output="$timeLeft mins" | |
| if [ $isCharging = "Yes" ] ; then |
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
| class Item < ActiveRecord::Base | |
| has_many :places, conditions: Proc.new { "filter_status = #{@filter_status}"} | |
| attr_accessor :filter_status | |
| 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
| source 'http://rubygems.org' | |
| gem 'sunzi' | |
| gem 'rake' | |
| gem 'fog' |
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
| def base_url | |
| @base_url ||= "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}" | |
| 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
| module Rack | |
| class Lint | |
| def call(env = nil) | |
| @app.call(env) | |
| end | |
| 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
| #!/bin/sh | |
| # ANDROID_NOTIFICATION is in the format DEVICE_ID/NOTIFICATION_ID/EVENT_TYPE/EVENT_CONTENTS | |
| NOTIFICATION_TYPE="`echo $ANDROID_NOTIFICATION | sed 's/.*\/.*\/\(.*\)\/.*/\1/'`" | |
| NOTIFICATION_DATA="`echo $ANDROID_NOTIFICATION | sed 's/.*\///'`" | |
| if [ $NOTIFICATION_TYPE == "RING" ]; then | |
| TEXT_TO_SAY="Call from" | |
| elif [ $NOTIFICATION_TYPE == "SMS" ]; then |
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 | |
| if __FILE__ == $0 | |
| bundle_name = ARGV[0] if (ARGV[0]) | |
| bundle_name = `pwd`.split('/').last.chomp if bundle_name.nil? | |
| bundle_name += ".git.bundle" | |
| puts "Backing up to bundle #{bundle_name}" | |
| `git bundle create ~/Dropbox/backup/git-repos/#{bundle_name} --all` | |
| 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
| class Unicorn::HttpParser | |
| alias old_read read | |
| def read(socket) | |
| env = old_read(socket) | |
| DEFAULTS["rack.logger"].debug env["REQUEST_PATH"] | |
| env | |
| 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
| class ActiveSupport::TimeWithZone | |
| alias_method :original_xmlschema , :xmlschema | |
| def xmlschema(fraction_digits = 3) | |
| original_xmlschema(fraction_digits) | |
| 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
| private void button2_Click(object sender, EventArgs e) | |
| { | |
| int i = 0; | |
| while (i < 10) | |
| { | |
| rc.ManualDrive(1, 1); | |
| i++; | |
| } |