Skip to content

Instantly share code, notes, and snippets.

View karno's full-sized avatar
🤔

Karno karno

🤔
View GitHub Profile
#!/usr/local/bin/python3
import urllib.request
urlfmt = "http://www.tbs.co.jp/anime/urara/special/img/stamp_{0:02d}/{1:02d}.png"
fnfmt = "{0:02d}_{1:02d}.png"
for di in range(1, 13):
for fi in range(1, 100):
try:
url = urlfmt.format(di, fi)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Text;
namespace Cadena.Meteor
{
public static class MeteorJson
{
using System;
namespace Cadena.Meteor
{
internal static class MeteorJsonHelper
{
public static unsafe string UnsafeUnescape(string jsonString, int decodedLength)
{
var len = jsonString.Length;
var buf = new char[decodedLength];
@karno
karno / TaskFactoryDistrict.cs
Created December 3, 2015 13:34
TaskScheduler with priorities and limited concurrency.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace Cadena.Engine._Internals
{
public sealed class TaskFactoryDistrict
{
@karno
karno / config.py
Created September 16, 2015 15:14
Masquerade system configuration file
#!/usr/bin/env python
# -*- coding: utf-8 -*-
config = {
"consumer": {
"key": "********",
"secret": "********",
},
"token": {
"key": "********",
@karno
karno / masqsvr.py
Created September 16, 2015 15:12
Masquerade system server program
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import io
import re
import threading
import time
from twitter import *
@karno
karno / masquerade.py
Created September 16, 2015 15:12
Masquerade system core program
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from twitter import *
from config import *
def switch_profile(key: str):
api = Twitter(auth=OAuth(
#!/usr/bin/env python
# -*- coding: utf-8 -*-
config = {
"consumer": {
"key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
},
"token": {
"key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from twitter import *
from config import *
def main(arg: str):
using (var reader = new CancellableStreamReader(stream))
{
while (true)
{
cancellationToken.ThrowIfCancellationRequested();
// create timeout cancellation token source
using (var timeoutTokenSource = new CancellationTokenSource(readTimeout))
using (var compositeTokenSource = CancellationTokenSource.CreateLinkedTokenSource(
cancellationToken, timeoutTokenSource.Token))