Skip to content

Instantly share code, notes, and snippets.

# Usage:
## cd /path/to/repository && ruby /path/to/repo_stat.rb
files = `git grep --cached -Il ''`.chomp.split("\n")
count_map = {}
files.each do |file|
ext = file.split(/[.\/]/).last
count = `cat #{file.gsub(" ", "\\ ")} | wc -l | tr -d ' '`.chomp.to_i
def doSomething(strategy: String => Unit): Unit = {
println("start")
// call strategy
strategy("SOME STRING")
println("end")
}
def justPrint(s: String): Unit = println(s)
import bpy
import math
def delete_all():
for item in bpy.context.scene.objects:
bpy.context.scene.objects.unlink(item)
for item in bpy.data.objects:
bpy.data.objects.remove(item)
for item in bpy.data.meshes:
bpy.data.meshes.remove(item)
/*/**/
class JavaMain {
public static void main(String args[]) {
System.out.println("Hello, World");
}
}
// */
/*/**/
class App {}
// */
@ocadaruma
ocadaruma / README.md
Last active November 24, 2018 03:47
Ubuntu setup notes

keybind

  • gnome-tweak-toolを入れてEmacs Input onにする
  • IntelliJ IDEAはkeymap.windows.as.meta=trueをidea.propertiesに書いて、Macと同じキーバインドを使えばOK
  • terminatorを入れて、キーバインドをよしなに設定する

PulseSecure

  • http://trial.pulsesecure.net/clients/ps-pulse-linux-5.3r3.0-b1021-ubuntu-debian-64-bit-installer.debを落としてきて、あとはマニュアル通りでOK
@ocadaruma
ocadaruma / README.md
Last active August 26, 2019 10:01
Redis HLL error
$ for i in `zcat numbers.txt.gz`; do redis-cli PFADD foo $i > /dev/null; done
$ redis-cli PFCOUNT foo
(integer) 1
----------------------------- MODULE PaxosCommit ----------------------------
(***************************************************************************)
(* This specification is discussed in "Paxos Commit", Lecture 6 of the *)
(* TLA+ Video Course. *)
(* *)
(* This module specifies the Paxos Commit algorithm. We specify only *)
(* safety properties, not liveness properties. We simplify the *)
(* specification in the following ways. *)
(* *)
(* - As in the specification of module TwoPhase, and for the same *)
---- MODULE BatchingProcessor ----
EXTENDS Sequences, Integers
CONSTANT BatchSize
(*--algorithm BatchingProcessor
variables
batch = <<>>;
flushTasks = <<>>;
flushedBatchSizeHistory = {};
% This is the excerpt from plain TeX format
% that contains minimal instructions to just print "Hello \TeX".
% catcode definitions
\catcode`\{=1 % left brace is begin-group character
\catcode`\}=2 % right brace is end-group character
\catcode`\$=3 % dollar sign is math shift
\catcode`\&=4 % ampersand is alignment tab
\catcode`\#=6 % hash mark is macro parameter character
\catcode`\^=7 \catcode`\^^K=7 % circumflex and uparrow are for superscripts
INIT Init
NEXT Next
INVARIANT NotSolved