Skip to content

Instantly share code, notes, and snippets.

Avatar

Kenn Ejima kenn

  • San Francisco
View GitHub Profile
@keihayashi
keihayashi / joining_google.md
Last active Oct 5, 2020
私はこうしてGoogleに入った (K)
View joining_google.md

※Googleを受けた体験というよりも、シリコンバレーでGoogle含めたIT企業のエンジニアポジションを受けた体験を述べております。Googleに特化した就活体験が聞きたい方は回れ右をお勧めします

目次:

  • 対策
  • 困難だった点
  • 如何にして最初の一社のオファーを貰うか?
  • 終わりに:現在とこれから

対策

View cointoss.scm
(use srfi-27)
(use srfi-42)
(use gauche.sequence)
(define *n* 10000)
(define *points* (make-vector *n* 0))
(define (reset init)
(set! *points* (make-vector *n* init)))
@kule
kule / mini_rspec.rb
Created Sep 11, 2018
Simplified example of how rspec works
View mini_rspec.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'colorize'
end
class MatcherInterface
def initialize(some_object)
@some_object = some_object
View tax.md

消費税の計算

  • 原材料: A社
  • 製造: B社
  • 卸: C社
  • 小売: D社

消費税が無い状態で、小売売価100、卸値70、製造販売価50、原材料価格20とする。1個商品が売れた場合

| |売価|仕入れ値|粗利|

@nilayp
nilayp / git-backup-to-Backblaze-B2.sh
Last active Mar 21, 2020 — forked from philippb/git-backup-to-AWS-S3.sh
Complete git repository backup script to Backblaze B2
View git-backup-to-Backblaze-B2.sh
#!/bin/bash
# Script to backup git repo to Backblaze B2
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc
# Ensure you have authorized the B2 command line tool with the correct account AND added your SSH
# public key to your github account, if you need to backup private repositories.
# To restore this repo in the future, download it from B2, extract it and then use this command:
# cd old-repository.git
View increment_and_decrement.rb
module IncrementAndDecrement
def increment(&block)
matcher = change(&block).by(1)
RSpec::Matchers::AliasedMatcher.new(matcher, lambda do |desc|
desc.gsub("changed", "incremented").gsub("change", "increment")
end)
end
def decrement(&block)
matcher = change(&block).by(-1)
View rails_single_file.rb
begin
require "bundler/inline"
rescue LoadError => e
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler"
raise e
end
gemfile(true) do
source "https://rubygems.org"
@antirez
antirez / lmdb.tcl
Created Apr 28, 2017
LMDB -- First version of Redis written in Tcl
View lmdb.tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!