This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function do_something() { | |
| print("first implementation") | |
| } | |
| function do_something() { | |
| print("second implementation") | |
| } | |
| do_something() // prints the latest implementation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function __escape_tmux() { | |
| if [ "$TERM" = "screen" ] && [ -n "$TMUX" ]; then | |
| printf "\033Ptmux;\033$@\033\\" >/dev/tty | |
| else | |
| echo -ne "$@" | |
| fi | |
| } | |
| runHtop() { | |
| __escape_tmux "\033]1337;PushKeyLabels\a" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ### tiktoff | |
| # usage: tiktoff | |
| # | |
| # STDIN receives 1 url to a tiktok video | |
| # tiktoff will rip the video | |
| # STDERR prints out the filename of the ripped video | |
| # | |
| ### |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| macro do_debug(name) | |
| module MyDebug{{name.id}} # use the run macro to md5 the name or something | |
| def name | |
| {{name}} | |
| end | |
| def debug(thing) | |
| puts("#{name}: #{thing}") | |
| end | |
| end | |
| include MyDebug{{name.id}} # use the run macro to md5 the name or something |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env crystal | |
| class Thread | |
| class MyThread | |
| @thread : LibC::PthreadT | |
| setter proc : Proc(Pointer(Void), Pointer(Void)) | |
| def initialize | |
| @thread = uninitialized LibC::PthreadT | |
| @proc = uninitialized Proc(Pointer(Void), Pointer(Void)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| count = 1 | |
| attempts = (ENV['TRAVIS_RETRY'] || 3).to_i | |
| command = ARGV.join(" ") | |
| puts "Attempting to run \"#{command}\". Will retry up to #{attempts} times." | |
| attempts.times do |attempt_number| | |
| attempt_number += 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ # no cache crystal run | |
| $ rm -rf $(crystal env CRYSTAL_CACHE_DIR)/* | |
| $ time crystal run sample.cr | |
| hello | |
| real 0m1.289s | |
| user 0m1.916s | |
| sys 0m0.375s | |
| $ # cached crystal run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ # no cache crystal run | |
| $ rm -rf $(crystal env CRYSTAL_CACHE_DIR)/* | |
| $ time crystal run sample.cr | |
| hello | |
| real 0m1.289s | |
| user 0m1.916s | |
| sys 0m0.375s | |
| $ # cached crystal run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ # no cache crystal run | |
| $ rm -rf $(crystal env CRYSTAL_CACHE_DIR)/* | |
| $ time crystal run sample.cr | |
| hello | |
| real 0m1.289s | |
| user 0m1.916s | |
| sys 0m0.375s | |
| $ # cached crystal run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| raspberry pi 0 w: | |
| $ 10.00 | |
| https://www.adafruit.com/product/3400 | |
| lipo shim: | |
| $ 9.95 | |
| https://www.adafruit.com/product/3196 | |
| lipo battery (3.7v 2000mAh): | |
| $ 12.50 |