Skip to content

Instantly share code, notes, and snippets.

@matope
matope / Dynamo: Amazonの高可用性Key-value Store.markdown
Last active November 18, 2022 17:54
Dynamo: Amazonの高可用性Key-value Store[和訳]

CRubyのGCの構造改革

やりたいこと

以下の6つの機能を分離し、簡単に切り替えられるようにしたい。

  1. OSからのメモリアロケータ
  • OSからメモリアロケートする部分のAPI
  1. Rubyのヒープ管理
  • ヒープの設定を保持
@handlename
handlename / notify.zsh
Last active February 16, 2018 05:58
notify after heavy command execution.
notify_start_time=0
notify_end_time=0
notify_threshold=10
notify_prev_command=""
notify_flag=0
function notify_preexec {
notify_flag=1
notify_start_time=`date +'%s'`
notify_prev_command="$2"
notify_start_time=0
notify_end_time=0
notify_threshold=10
notify_threshold2=30
notify_prev_command=""
notify_flag=0
function notify_preexec {
notify_flag=1
notify_start_time=`date +'%s'`
@ephemeralsnow
ephemeralsnow / gist:6020051
Created July 17, 2013 12:20
fluentd の out_file で出力したファイルを読み込んで in_forward へ投げる
require 'date'
require 'time'
require 'json'
require 'fluent-logger'
logger = Fluent::Logger::FluentLogger.new(nil, :host => '127.0.0.1', :port => 24224)
IO.foreach("fluentd_out_file.log") { |line|
line.scan(/^([^\t]+)\t([^\t]+)\t(.+)$/) { |a|
datetime = DateTime.parse(a[0])
time = datetime.to_time
@abbiekressner
abbiekressner / .octaverc
Created January 29, 2014 02:06
Enable plotting for Octave in iTerm
## The following allows plotting to work within iTerm.app
setenv GNUTERM qt
@sphaero
sphaero / gstreamer-build.sh
Last active February 11, 2023 16:25
Install & build gstreamer from git
#!/bin/bash --debugger
set -e
BRANCH="master"
if grep -q BCM2708 /proc/cpuinfo; then
echo "RPI BUILD!"
RPI="1"
fi
[ -n "$1" ] && BRANCH=$1
@fay59
fay59 / icloud-album-download.sh
Last active November 15, 2024 20:49
Download entire iCloud shared albums
#!/bin/bash
# requires jq
# arg 1: iCloud web album URL
# arg 2: folder to download into (optional)
function curl_post_json {
curl -sH "Content-Type: application/json" -X POST -d "@-" "$@"
}
@CMCDragonkai
CMCDragonkai / local_https_server_using_stunnel.md
Last active March 8, 2022 04:16
Local HTTPS Server using Stunnel #network #tls

Local HTTPS Server using Stunnel

You want an HTTPS server bound to localhost running in front of a HTTP server. This is pretty much needed if you're working on things that work only in HTTPS, such as HTTPS-only cookies and front end apps dealing with mixed content.

We can do this with Stunnel.

First create a self-signed certificate or acquire one from Let's Encrypt.

@lhns
lhns / afterPrintCancelled
Created December 23, 2018 14:44
OctoPrint GCODE Scripts
; disable motors
M84
; disable all heaters
{% snippet 'disable_hotends' %}
{% snippet 'disable_bed' %}
;disable fan
M106 S0
; relative XYZE