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
| BEGIN { | |
| range_min = 0.33 | |
| range_max = 0.48 | |
| range_size = range_max - range_min | |
| num_bins = int(range_size/0.003) | |
| bin_size = range_size / num_bins | |
| for(i=0;i<num_bins;++i) { | |
| freq[i] = 0 | |
| } | |
| } |
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/osascript | |
| -- tell application "loginwindow" to «event aevtrrst» | |
| tell application "loginwindow" to «event aevtrsdn» | |
| tell application "System Events" | |
| tell window 1 of process "loginwindow" | |
| click checkbox 1 | |
| -- click button 2 | |
| end tell |
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
| /* from http://www.ohfuji.name/?p=4 */ | |
| #include <cstdio> | |
| #include <cstdlib> | |
| #include <cstdarg> | |
| #include <vector> | |
| #include <string> | |
| #include <stdexcept> | |
| std::string str_printf(const char* const format, ...) | |
| { |
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
| #include <cstdio> | |
| #include <cstdlib> | |
| #include <cstring> | |
| #include <cerrno> | |
| #include <sys/types.h> | |
| #include <sys/socket.h> | |
| #include <netinet/in.h> | |
| #include <netdb.h> | |
| static int tcp_open(const char* const address, const u_short port) |
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
| #include <cstdlib> | |
| #include <cstdio> | |
| #include <cstring> | |
| #include <cstdarg> | |
| #include <cstddef> | |
| #include <cerrno> | |
| #include <sys/time.h> | |
| #define FUSE_USE_VERSION 26 |
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
| Defaults env_reset | |
| Defaults timestamp_timeout=3 | |
| Defaults env_keep += "EDITOR VISUAL" | |
| Defaults !tty_tickets | |
| Defaults env_editor |
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/ruby | |
| # -*- coding: utf-8 -*- | |
| require 'time' | |
| require 'net/imap' | |
| imap = Net::IMAP.new('imap.gmail.com', 993, true) | |
| imap.login('user@gmail.com', 'password') | |
| File::open("mail.txt") do |f| |
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
| #include <ApplicationServices/ApplicationServices.h> | |
| #include <vector> | |
| // void MyDisplaySwitchToMode (CGDirectDisplayID display, CFDictionaryRef mode) | |
| // { | |
| // CGDisplayConfigRef config; // 1 | |
| // CGBeginDisplayConfiguration (&config); // 2 | |
| // CGConfigureDisplayMode (config, display, mode); // 3 |
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/perl | |
| my $interval = 2; | |
| my $time_begin = time(); | |
| printf("# time_begin = %d\n", $time_begin); | |
| while (1) { | |
| printf("%d\t", time() - $time_begin); | |
| open(my $sensors, "sensors |"); | |
| while (my $line = readline $sensors) { |
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/ruby | |
| require 'rexml/document' | |
| require "net/https" | |
| require "uri" | |
| def to_frame(min, sec, f) | |
| return (min*60+sec)*75+f | |
| end |