Skip to content

Instantly share code, notes, and snippets.

View BanzaiMan's full-sized avatar

Hiro Asari BanzaiMan

View GitHub Profile
@MrTrustor
MrTrustor / clean-docker-for-mac.sh
Last active November 21, 2023 11:38
This script cleans the Docker.qcow2 file that takes a lot of disk space with Docker For Mac. You can specify some Docker images that you would like to keep.
#!/bin/bash
# Copyright 2017 Théo Chamley
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in the Software
# without restriction, including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
# to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
require 'webrick'
require 'webrick/https'
require 'ds9'
class HTTP2Server < WEBrick::HTTPServer
SETTINGS = [ [DS9::Settings::MAX_CONCURRENT_STREAMS, 100] ]
class HTTP2Response < WEBrick::HTTPResponse
def initialize config, ctx, stream_id
@ctx = ctx

On the Viability of Erlang Releases and CouchDB

There has been some discussion on what versions of Erlang CouchDB should support, and what versions of Erlang are detrimental to use. Sadly there were some pretty substantial problems in the R15 line and even parts of R16 that are landmines for CouchDB. This post will describe the current state of things and make some potential recommendations on approach.

Scheduler Collapse

@searls
searls / instructions.md
Created May 2, 2014 12:05
Creating a USB install disk of OS X Mavericks

Apple has changed how it distributes OS X Mavericks since its initial release in October 2013. This note was written on May 2, 2014. This affects the instructions you'll find online for how to make a bootable OS X installer.

It used to be that when you downloaded OS X from the App Store, the entire 5GB installer was placed in /Applications/Install OS X Mavericks.app. Now, there is a simple shortcut program placed in /Applications/OS X Mavericks.app. The app file is immediately removed in the event of an error or a successful post-install launch. When the download succeeds, the app file is launched which brings up the traditional install wizard, but this time mounted to /Volumes/Install OS X Mavericks.

I actually discovered this because if you already have a volume mounted of the same name (which I did, because I was trying to update my existing USB installer), the App Store download promptly fails right after finishing its download.

So if you have an empty disk you'd like to use as an installer that'

@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@headius
headius / ffi-jep.md
Last active January 26, 2016 00:57
JDK Enhancement Proposal: FFI

Title: Foreign Function Interface Author: Charles Oliver Nutter Organization: Red Hat Owner: Charles Oliver Nutter Created: 2014/01/28 Type: Feature State: Draft Exposure: Open Component: --/-- Scope: JDK

@roidrage
roidrage / meatballs.md
Last active December 5, 2019 22:44
Americanized version of my meatballs recipe

The @roidrage meatballs extravaganza.

The secret ingredient to this recipe is letting everything stew for a few hours. First the tomato sauce, requires at least 90 minutes to 2 hours. Then the meatballs in the sauce another 90 minutes. The longer the better.

Once the meatballs are in the sauce, the more time you give them, the more delicious flavor will seep from the meat into the sauce, and vice versa. I'd recommend giving it a total of four hours for maximum taste extraction.

The long stew ensure that the fluids have evaporated and that you're left with the tastiest meatballs you've ever had.

Ingredients (serves four hungry people):

@niw
niw / rubygems_server.rb
Created October 29, 2013 03:16
Running rubygems server on localhost.
#!/usr/bin/env ruby
require 'webrick'
require 'rubygems'
require 'rubygems/gem_runner'
require 'rubygems/exceptions'
REPOSITORY_ROOT = File.expand_path("../", __FILE__)
# Update index
@awwaiid
awwaiid / 01 hive.rb
Last active December 24, 2015 06:09
Everyone adds a line, one at a time!
#!/usr/bin/env ruby
if ARGV == ['who', 'is', 'this?']
puts "THIS IS SPARTA!!!"
end
puts (words = File.read('/usr/share/dict/words')).length
good_words = words.split.select {|w| w.size > 6}
puts good_words.sample(3).join(' ')
Thread.new{ STDERR.<< ", \n A PLAY IN 3 PARTS.\n\n============ PAGE " }
puts good_words.length
puts File.read(__FILE__).split.detect{|_| _ =~ /SPARTA/}
$ jruby -v
jruby 1.7.5.dev (1.9.3p392) 2013-09-04 090d5dd on Java HotSpot(TM) 64-Bit Server VM 1.7.0_25-b15 [darwin-x86_64]
$ time jruby -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Xverify:none -e 'require "rails"'
jruby -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-Xverify:none -e 5.18s user 0.47s system 136% cpu 4.142 total
$ time jruby -e 'require "rails"'
jruby -e 'require "rails"' 14.60s user 0.44s system 202% cpu 7.444 total