Skip to content

Instantly share code, notes, and snippets.

View jmettraux's full-sized avatar

John Mettraux jmettraux

View GitHub Profile
@Nyoho
Nyoho / 2017-0713-195342-hiroshimarb.org
Created July 16, 2017 07:05
Introducing LTI <2017-07-13 Thu> at Hiroshima.rb #057

Introducing LTI

<2017-07-13 Thu> at Hiroshima.rb #057

What’s LTI?

Learning Tools Interoperability® (LTI®) is a protocol or specification for e-Learning systems (LMS)

LMS = leaning management system, that is a CMS for education. (for example, Blackboard (Hiroshima University uses), moodle, …)

@seratch
seratch / abstract_in_japanese.md
Last active August 9, 2017 01:36
RubyKaigi 2017 CFP (not accepted)

私は Scala のフルスタック Web フレームワークの作者です。 そのフレームワーク、Skinny Framework のコンセプトは Scala on Rails で、このフレームワークは Ruby on Rails に強く影響を受けています。 このフレームワークはリリースされてしばらく経っており、国内外の企業で利用されています。

http://skinny-framework.org/

私は数年間 Scala を好んで使っていますが、同時にその間仕事では Rails エンジニアとして Web アプリケーション開発に従事してきました。 Rails コミュニティはとても大きく、Rails フォロワーのフレームワークメンテナとして、進化を続ける Rails コミュニティを追いかけていくことは簡単ではありませんでした。

それだけでなく、近年、Scala コミュニティは非同期な API を使った non blocking なアーキテクチャがトレンドになってきています。

@nishimotz
nishimotz / a1.py
Last active June 29, 2017 04:04
170628-great-h-python 「あれ」の例題をやってみた
src = None
with open('Q1/Q1.txt', encoding='utf-8') as f:
for s in f.readlines():
if s and s[0] == '"':
src = s.strip('"\n')
break
print(src)
#counts = {}
@simonw
simonw / recover_source_code.md
Last active January 16, 2024 08:13
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb
@wvengen
wvengen / README.md
Last active March 25, 2024 07:53
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@gerbsen
gerbsen / ssh_agent_start.fish
Last active January 26, 2024 08:13 — forked from schaary/ssh_agent_start.fish
Auto-launching ssh-agent in fish shell
# content has to be in .config/fish/config.fish
# if it does not exist, create the file
setenv SSH_ENV $HOME/.ssh/environment
function start_agent
echo "Initializing new SSH agent ..."
ssh-agent -c | sed 's/^echo/#echo/' > $SSH_ENV
echo "succeeded"
chmod 600 $SSH_ENV
. $SSH_ENV > /dev/null
@eddiemoore
eddiemoore / nric-validation.js
Last active October 17, 2022 05:39
Validation for Singapore NRIC and FIN number
//Based on http://www.samliew.com/icval/
function validateNRIC(str) {
if (str.length != 9)
return false;
str = str.toUpperCase();
var i,
icArray = [];
for(i = 0; i < 9; i++) {
@henrik
henrik / rules.md
Last active May 23, 2022 12:31
Sandi Metz' four rules from Ruby Rogues episode 87. Listen or read the transcript: http://rubyrogues.com/087-rr-book-clubpractical-object-oriented-design-in-ruby-with-sandi-metz/
  1. Your class can be no longer than 100 lines of code.
  2. Your methods can be no longer than five lines of code.
  3. You can pass no more than four parameters and you can’t just make it one big hash.
  4. When a call comes into your Rails controller, you can only instantiate one object to do whatever it is that needs to be done. And your view can only know about one instance variable.

You can break these rules if you can talk your pair into agreeing with you.

@caruccio
caruccio / bash-path-vars
Last active December 28, 2023 22:47
Path manipulation with bash vars
$ FILE=/some/path/to/file.txt
###################################
### Remove matching suffix pattern
###################################
$ echo ${FILE%.*} # remove ext
/some/path/to/file
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts
@rsms
rsms / gist:3564654
Created September 1, 2012 05:33
Life is purposeless. And it is beautiful that it is purposeless

Life is purposeless. And it is beautiful that it is purposeless

It is very difficult, particularly for the Western mind, to understand that life is purposeless. And it is beautiful that it is purposeless. If it is purposeful then the whole thing becomes absurd – then who will decide the purpose? Then some God has to be conceived who decides the purpose, and then human beings become just puppets; then no freedom is possible. And if there is some purpose then life becomes businesslike, it cannot be ecstatic.

The West has been thinking in terms of purpose, but the East has been thinking in terms of purposelessness. The East says life is not a business, it is a play. And a play has no purpose really, it is nonpurposeful. Or you can say play is its own purpose, to play is enough. Life is not reaching towards some goal, life itself is the goal. It is not evolving towards some ultimate; this very moment, here and now, life is ultimate.

Life as it is, is accepted in the East. It is not moving towards some end, b