Skip to content

Instantly share code, notes, and snippets.

View karno's full-sized avatar
🤔

Karno karno

🤔
View GitHub Profile
for (int i = 0; i < 1; i++)
{
Enumerable.Range(-3, 7)
.Select(v => 4 - Math.Abs(v))
.Select(v => new String('*', v))
.ToList()
.ForEach(Console.WriteLine);
}
@karno
karno / haru_lines.py
Last active August 29, 2015 14:07
はるアイコン鯖の路線コード候補
lineIdTable = {
# H: harutrak - @fubukiefsf
"HA": "harutrak A線",
"HB": "harutrak B線",
"HC": "harutrak C線",
"HD": "harutrak D線",
"HE": "harutrak E線",
"HF": "harutrak F線",
"HG": "harutrak G線",
"HH": "harutrak H線",
@karno
karno / haru_station_info.py
Last active August 29, 2015 14:07
はるアイコン鯖の路線ごとの駅位置情報など
# "路線コード": {
# "駅コード": (X, Y, Z, "駅名"), ...
# }, ...
stationInfoTable = {
# harutrak A
"HA": {
# 駅共有/相互直通: HBHH
"HH": (-285, 59, 346, "役場前"),
"NV": (-369, 70, 115, "中村"), # 298 blocks
@karno
karno / FragileCart.java
Created October 6, 2014 19:02
トロッコ自動破壊プラグインのコード
package com.troidworks.fragilecart;
import org.bukkit.Material;
import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerLoginEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.event.vehicle.VehicleExitEvent;
import org.bukkit.inventory.ItemStack;
@karno
karno / station.json
Last active August 29, 2015 14:07
station description
{
"lines": {
"HA": {
"name": "A線",
"company": "harutrak",
"author": "fubukiefsf",
"color": "#000000",
"stations": {
"HH": {
"share": ["HBHH"],
@karno
karno / MainPageViewModel.cs
Created December 22, 2014 09:13
Skylight example C# code
using TestApp.Views;
using Skylight;
using Skylight.Common;
using Skylight.Messaging;
using Windows.ApplicationModel.Activation;
using Windows.Storage.Pickers;
using Windows.UI.Popups;
namespace TestApp.ViewModels
{
@karno
karno / MainPage.xaml
Created December 22, 2014 09:14
Skylight example XAML code
<Page x:Class="TestApp.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:actions="using:Skylight.Messaging.Behaviors.Actions"
xmlns:behaviors="using:Skylight.Messaging.Behaviors"
xmlns:comb="using:Skylight.Common.Behaviors"
xmlns:core="using:Microsoft.Xaml.Interactions.Core"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="using:Microsoft.Xaml.Interactivity"
xmlns:local="using:TestApp"
@karno
karno / App.xaml.cs
Created December 22, 2014 09:17
Skylight example initialization code
using System;
using System.Threading.Tasks;
using TestApp.Common;
using Skylight.Common;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Navigation;
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))
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from twitter import *
from config import *
def main(arg: str):