This file contains 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
snippet php | |
<?php | |
${1} | |
?> | |
snippet pecho | |
<?php echo ${1} ?>${0} | |
This file contains 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
--- changelog.vim.old 2010-02-17 17:10:26.000000000 +0900 | |
+++ changelog.vim.new 2010-02-17 17:32:43.000000000 +0900 | |
@@ -121,12 +121,12 @@ | |
" Format used for new date entries. | |
if !exists('g:changelog_new_date_format') | |
- let g:changelog_new_date_format = "%d %u\n\n\t* %c\n\n" | |
+ let g:changelog_new_date_format = "%d %u\n\n\t*%p %c\n\n" | |
endif | |
This file contains 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 | |
for i in $@ | |
do | |
echo 'tell application "'${i}'" to activate' > ${i}_active.scpt | |
osacompile -o ${i}_active.scpt ${i}_active.scpt | |
done |
This file contains 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 | |
ioreg -n AppleSmartBattery | \ | |
awk '/MaxCapacity/ {MAX = $5} | |
/CurrentCapacity/ {CURRENT = $5} | |
/InstantTimeToEmpty/ {REMAIN = $5} | |
END { | |
printf("HP%d ",CURRENT/MAX*100) | |
if(REMAIN > 1000) | |
if(CURRENT == MAX) printf("(Charged)") |
This file contains 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
/* Show CPU Usage */ | |
#include <mach/mach.h> | |
#include <mach/mach_error.h> | |
#include <stdio.h> | |
int main() { | |
natural_t cpuCount; | |
processor_info_array_t infoArray; | |
mach_msg_type_number_t infoCount; | |
kern_return_t kr; |
This file contains 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 <mach/host_info.h> | |
#include <stdio.h> | |
int main(int argc, char *argv[]) | |
{ | |
struct host_basic_info host; | |
struct vm_statistics vm_info; | |
mach_msg_type_number_t count; | |
kern_return_t kr; | |
vm_size_t pagesize; |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
int main(int argc, char const* argv[]) | |
{ | |
int temp = 0; | |
char unit; | |
FILE *file = fopen("/Users/mfumi/.screen/.temp","r"); | |
if(file != NULL){ | |
fscanf(file,"%d %c",&temp,&unit); |
This file contains 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
import socket | |
import sys | |
PORT = 50000 | |
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) | |
s.connect(('localhost',PORT)) | |
s.send(sys.argv[1]) |
This file contains 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
import socket | |
import Skype4Py | |
PORT = 50000 | |
skype = Skype4Py.Skype() | |
skype.Attach() | |
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM) |
This file contains 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
1 0.01 s | |
2 0.02 s | |
3 0.07 s | |
4 0.12 s | |
5 0.17 s | |
6 0.21 s | |
7 0.33 s | |
8 0.61 s | |
9 0.93 s | |
10 1.50 s |