Skip to content

Instantly share code, notes, and snippets.

View grauwoelfchen's full-sized avatar
🐺
Typing with carved wooden keyboard ᕕ( ᐛ )ᕗ

Yasha grauwoelfchen

🐺
Typing with carved wooden keyboard ᕕ( ᐛ )ᕗ
View GitHub Profile
@rcoh
rcoh / otp.py
Last active August 17, 2023 08:03
An implementation of Google Authenticator Compatible 2-factor Codes
"""
An implementation of TOTP as described in https://tools.ietf.org/html/rfc6238#section-4 aka Google Authenticator Style 2-factor Auth
"""
import base64
import datetime
import hashlib
import hmac
import sys
import struct
import time

Erlang で、relx と sync を使ったお手軽自動リロード開発環境コトハジメ

relx コトハジメ の内容を把握している読者を想定しています。

Dockerイメージなどを開発環境にしていると、なるべく実際に動く環境に近いような動作環境でテストしたくなります。

一方で、開発環境というのはなるべく手間なく勝手にコンパイルやテストが走ったり、変更点を勝手にリロードしてほしいものです。

relx を使ってリリースイメージに近いような環境でソフトウェアを起動しつつ、 sync を使って自動コンパイル&リロードする環境を作ろうというのがこの記事の趣旨です。

I highly suspect that the RSpec core team all use black backgrounds in their terminals because sometimes the colors aren’t so nice on my white terminal

I certainly use a black background. I'm not sure about the other RSpec core folks. Regardless, if there are some color changes we can make that would make output look good on a larger variety of backgrounds, we'll certainly consider that (do you have some suggested changes?). In the meantime, the colors are configurable, so you can change the colors to fit your preferences on your machine. First, create a file at

diff --git a/gcimagebundle/gcimagebundlelib/platform_factory.py b/gcimagebundle/gcimagebundlelib/platform_factory.py
index da63f0e..c967813 100644
--- a/gcimagebundle/gcimagebundlelib/platform_factory.py
+++ b/gcimagebundle/gcimagebundlelib/platform_factory.py
@@ -25,6 +25,7 @@ from gcimagebundlelib import opensuse
from gcimagebundlelib import rhel
from gcimagebundlelib import sle
from gcimagebundlelib import ubuntu
+from gcimagebundlelib import gentoo
@mrueg
mrueg / kernel-config-check.py
Last active May 20, 2024 02:59
Kernel config checker
#!/usr/bin/env python
# Checking installed packages using linux-info.eclass
# for necessary kernel options
import portage
vartree = portage.db[portage.root]['vartree']
all_cpvs = vartree.dbapi.cpv_all()
settings = portage.config()
@kakutani
kakutani / Annotation.md
Last active September 26, 2019 13:35 — forked from ursm/Gemfile
Raw Gemfile on Idobata (master - 5adeddb)

Idobata Gemfile プレゼント

tl;dr IdotabaのGemfileは"全プレ"になりました。ご笑納ください。→ Gemfile

プレゼントについてのお詫び

rebuild.fmのep36でお知らせさせていただきました、Idobataの最新版Gemfileプレゼントをお届けいたします。 過日はIdobata会議01への多数のご参加ありがとうございました。おかげさまで盛況なミートアップとなりました。 (当日会場を提供いただいたEngine Yardさまのブログにて、Idobata会議01当日の様子がまとめられています。ありがとうございます!)

@miguelmota
miguelmota / README.md
Last active May 25, 2024 13:23
Multiple accounts with Mutt E-Mail Client (gmail example)

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
@essen
essen / my_module.erl
Created October 14, 2013 03:25
Thinking in Erlang: The Code
-module(my_module).
-export([my_function/1, my_function/2]).
-export([infinite_loop/0, f/1, r/2, sort/1]).
-export([only_primes/1, is_prime/1]).
my_function(A) when is_integer(A) ->
my_function(A, 0);
my_function(A) when is_list(A) ->
my_function(list_to_integer(A), 0).
@jj1bdx
jj1bdx / p3.erl
Last active March 11, 2016 19:05
Prime number generator with lazy evaluation in Erlang: See http://erlang.org/pipermail/erlang-questions/1999-March/000176.html
%%% Prime number sieve code with lazy evaluation by Joe Armstrong
%%% (very slightly modified for syntax check)
%%% http://erlang.org/pipermail/erlang-questions/1999-March/000176.html
-module(p3).
-export([from/1,filter/2,sift/2,sieve/1,primes/0, first/1]).
%% This generates a lazy sequence starting from K.
%% from(K) ->

Webmachine を使ったホットスワップ

更新:2013-02-22
バージョン:0.0.4
作者:@voluntas
URL:http://voluntas.github.com/

一度もサーバは落としてません