Skip to content

Instantly share code, notes, and snippets.

View azyobuzin's full-sized avatar

Takuya Sakurai azyobuzin

View GitHub Profile
(load "YacqOAuth")
(load "cts:System.Net")
;(createAuthorizationHeader "GET" (Uri "http://api.twitter.com/") "" "consumerKey" "consumerSecret" "token" "tokenSecret" HMAC-SHA1 "" "" Dictionary.[String String].(new))
;.(ForEach (\ [kvp]
; (+ kvp.Key " = " kvp.Value).(print)
;))
;.(print)
($
string ExpandUstreamUri(string uri)
{
const string alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
var id = uri.TrimStart("http://ustre.am/".ToArray());
return "http://www.ustream.tv/channel/id/" +
id.Reverse()
.Select((c, i) => Math.Pow(alphabet.Length, i) * alphabet.IndexOf(c))
.Sum();
}
@azyobuzin
azyobuzin / logfile.txt
Created September 29, 2012 11:06
Livet インストール エラー
=== ログ開始: 2012/09/28 23:18:12 ===
アクション 23:18:12: INSTALL。
アクション開始 23:18:12: INSTALL。
アクション 23:18:12: FindRelatedProducts。関連するアプリケーションを検索しています
アクション開始 23:18:12: FindRelatedProducts。
FindRelatedProducts: 見つかったアプリケーション: {4EDFDDC4-B4CC-45D2-99AD-D5A0B7135E3D}
アクション終了 23:18:12: FindRelatedProducts。 戻り値 1。
アクション 23:18:12: PrepareDlg。
アクション開始 23:18:12: PrepareDlg。
情報 2898。For WixUI_Font_Normal textstyle, the system created a 'Tahoma' font, in 128 character set, of 13 pixels height.
# -*- coding: utf-8 -*-
import MySQLdb
from wop_core import *
class MySqlWrapping:
def __init__(self):
self.db = MySQLdb.connect(user = db_name, passwd = db_password, db = db_name, charset = "utf8")
self.c = db.cursor()
@azyobuzin
azyobuzin / MapStringExWrapper.cs
Created December 2, 2012 10:56
C# Advent Calender 2012 6th
using System;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
namespace StrConvInCSharp
{
public static class MapStringExWrapper
{
[DllImport("Kernel32", CharSet = CharSet.Unicode, SetLastError = true, CallingConvention = CallingConvention.Cdecl)]
package net.azyobuzi.saostar.util;
import java.util.HashSet;
public class Notificator
{
private HashSet<Action> handlers = new HashSet<Action>();
public void add(Action handler)
{
using System;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
namespace StrConvInCSharp
{
public static class MapStringExWrapper
{
(load "cts:System.Linq.Expressions")
(load "cts:XSpect.Yacq.Symbols")
(load "cts:XSpect.Yacq.Expressions")
$global.(Add DispatchTypes.Method "assemblyfile" (\ [e s t]
Expression.(Constant
(type "System.Reflection.Assembly").(LoadFrom
e.Arguments.[0].(reduce).(to ConstantExpression).Value.(ToString)
)
)
@azyobuzin
azyobuzin / gist:4556069
Created January 17, 2013 14:00
pixiv_proxy
#!/virtual/azyobuzin/local/bin/python
# -*- coding: utf-8 -*-
import cgitb
cgitb.enable()
import sys
sys.path.append("resolvers")
import cookielib
@azyobuzin
azyobuzin / Program.cs
Created January 18, 2013 12:25
キルミーベイベーアイコンダウンローダー
using System;
using System.Linq;
using System.Net;
using System.Text.RegularExpressions;
namespace KillmebabyIconDownloader
{
class Program
{
static void Main(string[] args)