Skip to content

Instantly share code, notes, and snippets.

View tobynet's full-sized avatar

tobynet tobynet

  • Toyama, Japan
View GitHub Profile
@andrewgilmartin
andrewgilmartin / gist:26fd5b2ce02a3219c96c
Last active August 29, 2015 14:08
Bookmarklet to cleanup Kindle Your Highlights page
javascript:(function(){
var O = $('<div class="books"/>');
var S;
var xs = $("#allHighlightedBooks").children();
for ( var i = 0; i < xs.length; i++ ) {
var x = $(xs[i]);
var c = x.attr("class");
if ( c.indexOf("bookMain") != -1 ) {
t = $('.title',x).text();
a = $('.author',x).text();
#!/bin/sh
set -e
git push --all
git push --tags
@mattn
mattn / gist:50fa1dc854911d5cb797
Last active January 17, 2022 08:46
Vim script に lambda 関数を追加するパッチ
diff -r 1b74025a66e7 runtime/doc/eval.txt
--- a/runtime/doc/eval.txt Sat Sep 27 11:18:20 2014 +0200
+++ b/runtime/doc/eval.txt Sun Sep 28 23:39:50 2014 +0900
@@ -1869,6 +1869,7 @@
join( {list} [, {sep}]) String join {list} items into one String
keys( {dict}) List keys in {dict}
len( {expr}) Number the length of {expr}
+lambda( {expr}) Create lambda function constructed with {expr}
libcall( {lib}, {func}, {arg}) String call {func} in library {lib} with {arg}
libcallnr( {lib}, {func}, {arg}) Number idem, but return a Number
@voluntas
voluntas / eval.rst
Last active April 8, 2024 03:13
評価制度の無い評価制度
#!/usr/bin/ruby
require 'rss'
require 'open-uri'
require 'uri'
# 日本人っぽいのだけ欲しい場合'
URL = 'http://xpathfeed.com/feed?url=http%3A%2F%2Fjp.xvideos.com%2F&xpath_list=%2F%2F*%5B%40class%3D%22thumbBlock%22%5D%2Fdiv%2Fp%5B1%5D%2Fa'
RSS::Parser.parse(open(URL).read).channel.items.each{|x|
uri = URI.parse x.link
anonymous
anonymous / gist:19bbb1eadf4f1c6bd761
Created June 26, 2014 07:52
pecoで履歴からマッチするキーワードをその場に補完
function in_place_history_keyword_completion() {
pos=CURSOR # 現在のカーソル位置を取得
selected=$(history -10000 | cut -d' ' -f3- | tr '|' ' ' | tr ' ' '\n' | sort -u | peco) # 選択した結果
BUFFER="${BUFFER[1,$pos]}${selected}${BUFFER[$pos,-1]}"
CURSOR=$#BUFFER # move cursor
zle -R -c # refresh
}
zle -N in_place_history_keyword_completion
bindkey '^R' in_place_history_keyword_completion
@qnighy
qnighy / chomado-problem.v
Last active August 29, 2015 14:02
ちょまど問題 https://twitter.com/chomado/status/479227070975725569 を形式化したけど間違ってるかも
Require Import ssreflect ssrfun ssrbool eqtype ssrnat seq fintype.
Require Import tuple finfun finset.
Definition answer := 10.-tuple 'I_ 4.
Definition compare(a0 a1 : answer) : nat :=
count (fun x => fst x == snd x) (zip_tuple a0 a1).
CoInductive chomado :=
| decided : answer -> chomado
@mattn
mattn / grep.pl
Last active August 29, 2015 14:02
#!perl
use strict;
use warnings;
my $pattern = shift or die "usage: $0 [pattern]";
while(my $line = <STDIN>){
chomp $line;
print $line, "\n" if $line =~ /$pattern/;
}

Atomコードリーディングメモ

ビルド方法

script/build

起動したらsrc/window-bootstrap.coffeeが起動時間のログを出してるので、そいつをgrepすると/src/broweser/atom-application.coffee が引っかかる。

src/broweser/atom-application.coffee は、 src/browser/main.coffee に呼ばれている

@gakuzzzz
gakuzzzz / 1_.md
Last active August 2, 2023 01:59
Scala の省略ルール早覚え

Scala の省略ルール早覚え

このルールさえ押さえておけば、読んでいるコードが省略記法を使っていてもほぼ読めるようになります。

メソッド定義

def concatAsString(a: Int, b: Int): String = {
  val a_ = a.toString();
  val b_ = b.toString();