Skip to content

Instantly share code, notes, and snippets.

@kddnewton
kddnewton / json.rb
Last active October 6, 2023 09:25
JSON parser with pattern matching
require "json"
struct = { "a" => 1, "b" => 2, "c" => [1, 2, 3], "d" => [{ "e" => 3 }, nil, false, true, [], {}] }
source = JSON.dump(struct)
tokens = []
index = 0
until source.empty?
tokens <<
@YusukeHosonuma
YusukeHosonuma / jojo.md
Created May 8, 2022 05:35
開発で使えるJOJOの名言集

この○○が金やちやほやされるために技術ブログを書いていると思っているのかァーッ!!

技術ブログを書いていることをアフェリエイト目的とか、PV目的だとか言われた時に。

なるほど完璧な開発プロセスっスねーーーっ不可能だという点に目をつぶればよぉ〜

一見完璧に聞こえるけど、どう考えたって上手く回らない開発プロセスの説明を受けた時に。

理解不能理解不能・・・あ、理解可能

ようやく理解できた時に。

お前は1つの修正が終わったらキチっとコミットしてから次の修正に入るだろう? 誰だってそーする。俺もそーする。

@kakutani
kakutani / reading-polished-ruby-translation.md
Last active November 3, 2021 14:06
Polished Ruby Programming翻訳査読書(のようなもの)

"Polished Ruby Programming" by Jeremy Evans

-- Build better software with more intuitive, maintainable, scalable, and high-performance Ruby code

「Rubyの磨きかた -- わかりやすくてメンテナンスしやすい、スケール可能で高性能なRubyコードでソフトウェアを上手につくろう」みたいな感じ?

https://www.packtpub.com/product/polished-ruby-programming/9781801072724

  • Publication date: June 2021
  • Publisher: Packt
  • Pages: 381
@voluntas
voluntas / loadtest.rst
Last active April 3, 2024 03:25
負荷試験コトハジメ
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 23, 2024 11:47
set -e, -u, -o, -x pipefail explanation
@mono0926
mono0926 / commit_message_example.md
Last active March 29, 2024 03:40
[転載] gitにおけるコミットログ/メッセージ例文集100
@keijiro
keijiro / 00_README.md
Last active April 6, 2022 07:26
About Xcode Manipulation API in Unity

Unity から出力される Xcode プロジェクトをカスタマイズする方法 - Xcode Manipulation API

Unity 5 には Xcode Manipulation API が標準で搭載されており、これを使うことで、Unity の出力する Xcode プロジェクトを比較的簡単にカスタマイズすることができます。

ここでは例として、Unity から出力される Xcode プロジェクトの Info.plist ファイルを書き換えてみます。

下にある XcodeProjectUpdater.cs がそれです。このファイルを Editor ディレクトリ下に放り込んでおきます。すると、ビルド時に Info.plist を書き換えて、“TestEntry” というキーに “Hello” という値を設定します。見たそのまんまのシンプルな内容です。

鍵となるのは UnityEditor.iOS.Xcode に用意されている PlistDocument と PBXProject です。これらのクラスを使うことで、plist ファイルや Xcode プロジェクトファイルの書き換えが簡単に行えるわけです。

@phrawzty
phrawzty / 2serv.py
Last active April 26, 2024 03:28
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.xml with the following command:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import BaseHTTPServer, SimpleHTTPServer
import ssl
@jendiamond
jendiamond / gist:6128723
Last active April 11, 2024 11:35
Creating your own Gem & Command Line Interface Using Bundler

Presentation slides

Create a Gem - Make it a CLI - Add Rspec Tests

Create a Gem - Make it a Command Line Interface - Add Rspec Tests Using Bundler & Thor

#Creating your own Gem

  1. Run this command in your Terminal. This creates and names all the files you need for your gem. We are going to create a Lorem Ipsum Generator; you can call it whatever you want but seeing as we are creating a Lorem Ipsum generator we'll call it lorem. Read about gem naming conventions.