Skip to content

Instantly share code, notes, and snippets.

View mmisono's full-sized avatar
🌫️
I may be slow to respond.

Masanori Misono mmisono

🌫️
I may be slow to respond.
View GitHub Profile
snippet php
<?php
${1}
?>
snippet pecho
<?php echo ${1} ?>${0}
--- 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
#!/bin/sh
for i in $@
do
echo 'tell application "'${i}'" to activate' > ${i}_active.scpt
osacompile -o ${i}_active.scpt ${i}_active.scpt
done
#!/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)")
/* 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;
#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;
#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);
import socket
import sys
PORT = 50000
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(('localhost',PORT))
s.send(sys.argv[1])
import socket
import Skype4Py
PORT = 50000
skype = Skype4Py.Skype()
skype.Attach()
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
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