Skip to content

Instantly share code, notes, and snippets.

View jojonki's full-sized avatar

Junki Ohmura jojonki

View GitHub Profile
@uasi
uasi / create-chrome-launcher.sh
Created March 23, 2011 05:31
Create an .app that launches Google Chrome with a specified profile
#!/bin/sh
#
# Create Google Chrome launcher (for Mac)
#
CHROME_APP="/Applications/Google Chrome.app"
CHROME_PROFILE_DIR="$HOME/Library/Application Support/Google/Chrome"
echo "Enter profile name: \c"
@naaman
naaman / delete-heroku-apps.sh
Last active March 5, 2021 20:57
[WARNING THIS WILL HARD DELETE YOUR APPS. YOU COULD LOSE DATA. MAKE SURE YOU KNOW WHAT YOURE DOING!!!!!!!!!!] Delete all heroku apps from bash terminal -- no script file required
for app in $(heroku apps); do heroku apps:destroy --app $app --confirm $app; done
@ikegami-yukino
ikegami-yukino / anti_lou
Created March 27, 2012 08:04
Bilingual Emacspeak Project(BEP)辞書からルー語臭さをなるべく取り除く
perl -pe 's/(?=[ドト])ゥ(?<!ー)//g;s/(?<=[キシチニヒミリィ])イ/ー/g;s/(?<=[ァゥェォ])ィ/イ/g;s/イション/ーション/g;s/ォウ/ォー/g;s/スィ/シー/g;s/ロウ/ロー/g;s/゛//g;s/ウカ/ーカ/g;s/トギャザー/トゥゲザー/g;s/ボキャビュラリー/ボキャブラリー/g;' < bep-eng.dic.txt
@JeffPaine
JeffPaine / make_github_issue.py
Created July 19, 2012 17:24
Make an issue on github using API V3 and Python
import json
import requests
# Authentication for user filing issue (must have read/write access to
# repository to add issue to)
USERNAME = 'CHANGEME'
PASSWORD = 'CHANGEME'
# The repository to add this issue to
REPO_OWNER = 'CHANGEME'
@ybenjo
ybenjo / biterm_topic_model.rb
Last active June 3, 2023 03:16
biterm topic model(www2013)
# Xiaohui Yan, A biterm topic model for short texts(WWW 2013)
require 'set'
class Biterm
def initialize(alpha, beta, k)
@alpha = alpha
@beta = beta
@k = k
@doc_w = { }
@neubig
neubig / crf.py
Created November 7, 2013 10:59
This is a script to train conditional random fields. It is written to minimize the number of lines of code, with no regard for efficiency.
#!/usr/bin/python
# crf.py (by Graham Neubig)
# This script trains conditional random fields (CRFs)
# stdin: A corpus of WORD_POS WORD_POS WORD_POS sentences
# stdout: Feature vectors for emission and transition properties
from collections import defaultdict
from math import log, exp
import sys

C++初心者がC++を使って競技プログラミングするための備忘録のようなもの

この記事は、C++ (fork) Advent Calendar 2013の12日目の記事です。

はじめに

記事を書く人が居ないみたいなので、C++初心者ですが箸休め的な記事を書こうと思い立ち、いざ書き上げてみたら思いの外長くなりました。

この記事は、C++初心者な著者が、C++を用いて競技プログラミングをするために、調べたことや試した事などのまとめです。 記事中に誤り、問題点やご指摘、ご質問等ありましたら、@rigibunまでご連絡下さい(特にpush_bach)

githubのmarkdownを使いたかったことと、変更履歴が見られることからgistで書きました。

@chiral
chiral / lda_cgs.R
Last active May 4, 2019 13:16
An implementation of Collapsed Gibbs sampling algorithm for LDA in R
# LDA collapsed Gibbs sampler implementation in R by isobe
bows2corpus <- function(bows) {
print("bows2corpus")
docs <- list()
words <- c()
index <- list()
last_index <- 0
@code-of-kpp
code-of-kpp / plot_roc.py
Created August 11, 2014 02:43
Python pyplot receiver operating characteristic (ROC) curve with colorbar
import numbers
import six
import numpy
import matplotlib.collections
from matplotlib import pyplot
# using example from
# http://nbviewer.ipython.org/github/dpsanders/matplotlib-examples/blob/master/colorline.ipynb
@TakahikoKawasaki
TakahikoKawasaki / sinatra+thin+ssl.rb
Last active October 19, 2023 14:38
Sinatra + Thin + SSL
#!/usr/bin/env ruby
#
# This code snippet shows how to enable SSL in Sinatra+Thin.
#
require 'sinatra'
require 'thin'
class MyThinBackend < ::Thin::Backends::TcpServer
def initialize(host, port, options)