This file contains 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
export function hello() { | |
console.log("Hello, world!"); | |
} |
This file contains 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/sh | |
if [ "${1}" = '-f' ]; then | |
cmd='git branch -D' | |
else | |
cmd='echo Will delete' | |
fi | |
LANG=en_US.UTF-8 \ | |
git branch --list --format '%(upstream:track,nobracket):%(refname:lstrip=2)' | \ |
This file contains 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
" Plugins | |
call plug#begin('~/.local/share/nvim/plugged') | |
Plug 'arcticicestudio/nord-vim' | |
Plug 'tpope/vim-fugitive' | |
Plug 'airblade/vim-gitgutter' | |
call plug#end() | |
" Basic settings | |
set number |
This file contains 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
struct Manager { | |
callbacks: Vec<Box<FnMut()>>, | |
} | |
impl Manager { | |
fn new() -> Manager { | |
Manager { callbacks: Vec::new() } | |
} | |
fn register(&mut self, callback: Box<FnMut()>) { |
This file contains 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
adaedra › ll sample | |
-rw-r--r-- 1 adaedra wheel 1.0G May 18 20:22 sample | |
adaedra › time shasum -a 512 sample | |
91db271ec41220b0a608b32e59785b062bb06ca6df87c0750d44c10b17914f23ca87b5a486827a3a5dd34d56786c991ef58ac5c9f7d74b084b1fecec92034cf2 sample | |
shasum -a 512 sample 3.79s user 0.21s system 99% cpu 3.999 total | |
adaedra › time ruby -rdigest -e "puts Digest::SHA512.file('sample').hexdigest" | |
91db271ec41220b0a608b32e59785b062bb06ca6df87c0750d44c10b17914f23ca87b5a486827a3a5dd34d56786c991ef58ac5c9f7d74b084b1fecec92034cf2 | |
ruby -rdigest -e "puts Digest::SHA512.file('sample').hexdigest" 1.76s user 0.25s system 99% cpu 2.015 total |
This file contains 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
adaedra › touch toto | |
adaedra › pry | |
[1] pry(main)> Dir.mkdir 'toto' rescue $! | |
=> #<Errno::EEXIST: File exists @ dir_s_mkdir - toto> |
This file contains 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
Application = proc do |env| | |
names = env['names'] || %w[world] | |
text = "Hello, #{names.join ', '}!" | |
[200, {'Content-Type' => 'text/plain'}, [text]] | |
end | |
class NameMiddleware | |
def initialize(app) | |
@app = app | |
end |
This file contains 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
[1] pry(main)> RUBY_ENGINE | |
=> "ruby" | |
[2] pry(main)> def foo(a, b = nil, c:, d: nil); end | |
=> :foo | |
[3] pry(main)> method(:foo).parameters | |
=> [[:req, :a], [:opt, :b], [:keyreq, :c], [:key, :d]] | |
[4] pry(main)> |
NewerOlder