Skip to content

Instantly share code, notes, and snippets.

Avatar

moyashi moyashi

View GitHub Profile
View NetWalkerでradiko.jpを聴く
./rtmpdump -vr rtmp://radiko.smartstream.ne.jp/TBS/_defInst_/simul-stream -o - | ffmpeg -y -i - -vn -f au - 2>/dev/null | aplay
rtmpdumpはUbuntuのリポジトリに登録されていないですが、うちのリポジトリに登録しておきました。
http://moyashi.air-nifty.com/hitori/2009/09/netwalkertwitpi.html
「rtmpdump」で検索すると出てくると思います。
rtmpdumpはsudo aptitude install libssl-devしてあればmake posixできると思います。
mplayerはNetWalkerへのインストールが難しそうなのでaplayで代用。
View gist:339164
#import <sys/time.h>
#define JST_OFFSET 32400
struct timeval tNewTime;
NSURL *poURL = [NSURL URLWithString:@"http://www.google.co.jp/"];
NSMutableURLRequest *poURLReq = [NSMutableURLRequest requestWithURL:poURL];
[poURLReq setHTTPMethod:@"TRACE"];
NSHTTPURLResponse *poURLResp;
NSError *poErr;
View gist:395285
//iPhoneのOperaのInfo.plistにURL Schemeを追加するコマンド
#import <Foundation/Foundation.h>
#include <unistd.h>
#define VERSION 0.1
extern char *optarg;
extern int optind, opterr;
View SelfProverforActionMenu.m
//
// SelfProver for Action Menu
//
// Ver.0.1
// Created by moyashi on 05.24.10.
//
// History
//
// Ver.0.1
// Created by moyashi on 05.24.10.
View TweetParakeet draft save patch
#!/usr/bin/cycript -p TweetParakeet
var postViewDidAppear = TPPostViewController.messages['postViewDidAppear'];
TPPostViewController.messages['postViewDidAppear'] = function () {
postViewDidAppear.call(this);
var defaults = [NSUserDefaults standardUserDefaults];
var draft = [defaults stringForKey:@"Draft"];
if (draft && draft != "") {
if (![defaults boolForKey:@"PostStatusDidFinish"]) {
View battlog.m for iPhone
//
// batterylevel
//
// Ver.0.1
// Created by moyashi on 18.01.09.
//
#import <Foundation/Foundation.h>
#import <CoreFoundation/CoreFoundation.h>
#import <IOKit/ps/IOPowerSources.h>
View gist:462762
#import "StatusBarCustomClockRefreshTimer.h"
@class SBStatusBarDataManager;
@implementation StatusBarCustomClockRefreshTimer
- (id) init {
if(self = [super init]){
timer = [NSTimer scheduledTimerWithTimeInterval:0.5
target:self
selector:@selector(onTimer:)
View my-toggle-bool.el
(defun my-toggle-bool()
"Invert bool value at point."
(interactive)
(skip-chars-backward "YESNOTRUEFALSEtruefalsetnil")
(or (looking-at "\\(TRUE\\|FALSE\\|true\\|false\\|YES\\|NO\\|t\\|nil\\)")
(error "No bool at point"))
(cond
((equal (match-string 0) "TRUE")
(replace-match "FALSE"))
((equal (match-string 0) "FALSE")
View undeb
#!/bin/sh
# example: undeb com.hoge_0.1.deb
if [ $# -ne 1 ]; then
echo "ERROR: wrong number of arguments."
exit 1
fi
if [ -f $1 ]; then
View addfw
#!/bin/sh
# example: addfw 4.0.1 com.hoge_0.1
if [ $# -ne 2 ]; then
echo "ERROR: wrong number of arguments."
fi
if [ -d $2 ]; then
control=${2%/}/DEBIAN/control
You can’t perform that action at this time.