Skip to content

Instantly share code, notes, and snippets.

View ys's full-sized avatar
💭
Doing stuff with computers

Yannick Schutz ys

💭
Doing stuff with computers
View GitHub Profile
#!/bin/bash
# Fill Disk with random data for testing
myname=`basename $0`
usage() {
echo "Usage: $myname [-d dircount] [-f filecount] [-b maxblockcount] [-s blocksize] [-v] [-q] [-h]"
exit 0
}
help() {
def tar(path)
base_path = path.split("/")[0..-2].join("/")
folder = path.split("/")[-1]
if File.exist?(".gitignore")
ok = system("/usr/bin/tar -C \"#{base_path}\" --exclude='.git' --exclude-from=.gitignore -cvzf \"#{tempfile}\" \"#{folder}\"")
else
ok = system("/usr/bin/tar -C \"#{base_path}\" -cvzf \"#{tempfile}\" \"#{folder}\"")
end
unless ok
raise StandardError, $?

JAPANESE ICED COFFEE

Materials

  • 30 grams of coffee
  • 250 grams of hot water
  • 250 grams of ice
  • Your favorite pour over device (Chemex, Hario V60, Beehouse Dripper, Kalita Wave, etc.)
  • A container to brew into (mug, Chemex, mason jar, serving carafe, etc.)
  • A filter
  • A scale
#! /usr/bin/env ruby
issue= ARGV.shift
current_branch = `git rev-parse --abbrev-ref HEAD`
default_branch = ENV.fetch("DEFAULT_BRANCH", "master")
origin_url = `git config --get remote.origin.url`
if origin_url.start_with?("git")
repo = origin_url.split(':')[1].split('.')[0]
else
repo = origin_url.sub('https://github.com/', '').split('.')[0]
diff --git a/physical/s3.go b/physical/s3.go
index 398ada5..fb50248 100644
--- a/physical/s3.go
+++ b/physical/s3.go
@@ -32,7 +31,10 @@ func newS3Backend(conf map[string]string) (Backend, error) {
bucket, ok := conf["bucket"]
if !ok {
- return nil, fmt.Errorf("'bucket' must be set")
+ bucket = os.Getenv("AWS_S3_BUCKET")
@ys
ys / questions.md
Last active October 28, 2015 10:28
The Belgian setup
  • Who are you, and what do you do?
    • Can be also about personal matters, beverages and interests.
  • What hardware do you use?
  • What software?
  • Where kind of projects?
    • Hosting?
    • Team size?
    • Project size?
    • Roles inside the team?
  • How do you monitor and alert?
source /usr/local/share/chruby/chruby.sh && source /usr/local/share/chruby/auto.sh; chruby_auto && bundle exec rspec --tty {relative_path}:{line_number}
<link href="http://code.divshot.com/geo-bootstrap/swatch/bootstrap.min.css" rel="stylesheet"/>
<style>
body{
background: white !important;
}
h1{
text-align: center;
margin: 50px;
}
<link href="http://code.divshot.com/geo-bootstrap/swatch/bootstrap.min.css" rel="stylesheet"/>
<div class=container>
<h1><font color="#FF0000">Y</font><font color="#FF5A00">a</font><font color="#FFB400">n</font><font color="#A5ff00">n</font><font color="#4Bff00">i</font><font color="#00ff00">c</font><font color="#00ff5A">k</font><font color="#FFff00"> </font><blink><font color="#00ffB4">O</font><font color="#00ffff">R</font><font color="#00B4ff">V</font><font color="#005Aff">A</font><font color="#0000ff">L</font></blink></h1>
<div class="span12">
<marquee>I LOVE ORVAL</marquee>
</div>
</div>
class Object
def safe_tap(&block)
tap do |o|
unless o.nil?
block.call(o)
end
end
end
end