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
| $("form").find("input[type=text]").filter(".YOUR-CLASS-HERE:visible:first").focus(); |
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
| sub getUTCTimestamp { | |
| my ($localTime, @t, $offset); | |
| $localTime = time; | |
| @t = localtime(time); | |
| $offset = timegm(@t) - timelocal(@t); | |
| $offset =~ s/\-//g; | |
| return ($localTime + $offset); | |
| } |
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
| #OLD | |
| sub humanBytes { | |
| my $bytes = shift(@_); | |
| if ($bytes > 1125899906842624){ | |
| return sprintf("%.2f Pb", $bytes / 1125899906842624); | |
| }elsif ($bytes > 1099511627776){ | |
| return sprintf("%.2f Tb", $bytes / 1099511627776); | |
| }elsif ($bytes > 1073741824){ | |
| return sprintf("%.2f Gb", $bytes / 1073741824); | |
| }elsif ($bytes > 1048576){ |
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 'uri' | |
| require 'json' | |
| require 'net/http' | |
| require 'net/https' | |
| uri = URI.parse("https://leonschools.weatherstem.com/api") | |
| https = Net::HTTP.new(uri.host, uri.port) | |
| https.use_ssl = true |
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
| package main | |
| import ( | |
| "net/http" | |
| "strings" | |
| "io/ioutil" | |
| "fmt" | |
| "crypto/tls" | |
| ) |
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
| <?php | |
| $url = 'https://leonschools.weatherstem.com/api'; | |
| $vars = array( | |
| "stations" => array("canopyoaks"), | |
| "api_key" =>"cs9ynb6t" | |
| ); | |
| $options = array( | |
| 'http' => array( |
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
| $("#yourIDHERE").append('<option value="something">Your text here</option>'); | |
| $("#yourIDHERE").append( $("<option/>", {value: "something", text: "Your text here"}) ); | |
| $("#yourIDHERE").append('<option value="gte">≥</option>'); | |
| $("#yourIDHERE").append( $("<option/>", {value: "gte", html: "≥"}) ); |
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
| 53440 - Mon Mar 10 13:38:19 2014 sleeping for: 60 | |
| 53436 - Mon Mar 10 13:38:27 2014 sleeping for: 83 | |
| 53440 - Mon Mar 10 13:39:19 2014 sleeping for: 0 | |
| 53440 - Mon Mar 10 13:39:19 2014 sleeping for: 23 | |
| 53440 - Mon Mar 10 13:39:42 2014 sleeping for: 91 | |
| 53436 - Mon Mar 10 13:39:50 2014 sleeping for: 28 | |
| 53436 - Mon Mar 10 13:40:18 2014 sleeping for: 38 | |
| 53436 - Mon Mar 10 13:40:56 2014 sleeping for: 86 |
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 Ubic::Multiservice::Simple; | |
| use Ubic::Service::SimpleDaemon; | |
| return Ubic::Multiservice::Simple->new({ | |
| map { ( | |
| "worker$_" => Ubic::Service::SimpleDaemon->new({ | |
| bin => "/home/steve/worker.pl", | |
| }) | |
| )}(1..2) | |
| }); |
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/local/bin/perl | |
| my $outputFile = '/home/steve/test.log'; | |
| while (1){ | |
| my $sleepTime = int( rand( 120 ) ); | |
| open my $fh, '>>', $outputFile; | |
| print $fh $$." - ".localtime." sleeping for: ".$sleepTime."\n"; | |
| close $fh; | |
| sleep( $sleepTime ); |