Skip to content

Instantly share code, notes, and snippets.

View paralleltree's full-sized avatar
🐱
Meow

Ryo Namiki paralleltree

🐱
Meow
View GitHub Profile
html
head
meta charset="utf8"
script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.3/Chart.bundle.js"
script src="loader.js"
style type="text/css"
|
.wrapper {
width: 80%;
@paralleltree
paralleltree / pb
Created January 19, 2018 10:50
PushBullet command
#!/usr/bin/env ruby
# requirements: ruby-pushbullet gem
require 'pushbullet'
if ARGV.count == 0
name = __FILE__.tap { |f| break File.basename(f, File.extname(f)) }
warn "#{name} - An client of Pushbullet"
warn "Usage: #{name} [title] [file]"
warn "If no input files are specified, then the standard input is read."
exit 1
@paralleltree
paralleltree / felica_idm.rb
Last active March 31, 2017 00:33
Reading IDm from a FeliCa card with libpafe-ruby
require 'pasori'
begin
Pasori.open do |p|
warn 'Waiting for a card...'
begin
p.felica_polling do |f|
warn 'Reading...'
puts sprintf("%016X", f.idm.unpack('Q>').first)
end
#!/bin/bash
# add mono repository
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
# install mono-devel
sudo apt-get update
sudo apt-get install -y mono-devel
#! /bin/sh
exec ruby -S -x "$0" "$@"
#! ruby
require 'time'
require 'open-uri'
require 'optparse'
## Example of execution
# timecrawler http://example.com/images/%Y%m%d/%H%M%S.png \
@paralleltree
paralleltree / coordinates
Created July 15, 2016 11:02
picojsonのサンプル
10 20
60 20
90 45
@paralleltree
paralleltree / pdfgen
Created June 24, 2016 10:19
generate a pdf file from the tex file
#!/bin/sh
set -eu
## tex to pdf
# ex.) pdfgen sample.tex
# ex.) pdfgen sample.tex | xargs evince
test $# -eq 1 || {
NAME="$(basename $0)"
echo "$NAME - generate a pdf file from the tex file" >&2
#!/usr/bin/env ruby
if (ARGV.count != 2)
puts 'Invalid number of arguments.'
exit
end
a, b = ARGV.map { |s| s.to_i }
get_gcd = -> (m, n) do
#!/usr/local/bin/ruby
start = Time.now
# --- arguments check
if (ARGV.count != 1)
puts 'Invalid number of arguments.'
exit 1
end
@paralleltree
paralleltree / procon.cs
Created April 2, 2015 12:58
学内ミニプロコン(15/04/02)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
class Program
{
// ref: https://github.com/OCTPC/miniprocon/blob/master/miniprocon003/regulation.md
int n, m;
List<int>[] g;