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
package migration | |
type Migrator interface { | |
Migrate() error | |
} |
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
# cd to the folder where you have your .mov video files. | |
find . -name \*.mov -print0 | xargs -0 -I{} ffmpeg -i {} -f mp4 -vcodec libx264 -preset fast -profile:v main -acodec aac -vf scale=1024:576 {}.mp4 |
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
{ | |
'type': 'RGB' | |
'bandInfo': { | |
0 : { 'type': '...', 'colorinterpreter': 'R' } | |
1 : { 'type': '...', 'colorinterpreter': 'G' } | |
} | |
'cogInfo': {} | |
'mapTile': {} | |
} |
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
FROM python:3.6-slim-stretch | |
ADD requirements.txt /tmp/requirements.txt | |
RUN apt-get update && \ | |
apt-get install -y \ | |
build-essential \ | |
make \ | |
gcc \ | |
locales \ |
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
package models_test | |
import ( | |
"testing" | |
"github.com/stretchr/testify/assert" | |
) | |
func TestMeta_ToJson(t *testing.T) { | |
assert := assert.New(t) |
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
# Class variables with @ are accessible from class methods! | |
class MyClass | |
@var = 2 | |
def self.square | |
@var *= @var | |
end | |
end | |
MyClass.square |
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
req = RestClient::Request.new(url: "www.google.com", method: 'get') | |
net_http_resp = Net::HTTPResponse.new(1.0, 200, "OK") | |
net_http_resp.add_field 'Set-Cookie', 'Monster' | |
resp = RestClient::Response.create(response_body.to_json, net_http_resp, req) |
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
# * 100,000,000-line file generated by seq 100000000 > test.in | |
# * Reading lines 50,000,000-50,000,010 | |
# * Tests in no particular order | |
# * real time as reported by bash's builtin time | |
# https://unix.stackexchange.com/questions/47407/cat-line-x-to-line-y-on-a-huge-file | |
awk 'NR >= 57890000 && NR <= 57890010' /path/to/file | |
awk 'NR < 57890000 { next } { print } NR == 57890010 { exit }' /path/to/file | |
tail -n+50000000 test.in | head -n10 |
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
=begin | |
Usage: | |
[1, 4, 7, 2, 19].each do |i| | |
Logging::Block.start(:type, Logging::Logger) do |list| | |
list.item_with_uuid(i, {i: i}) do |item| | |
if i < 7 | |
item.success({i: i}) | |
else |
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
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )" | |
PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} $(git_prompt_info)%{$reset_color%} | |
' | |
RPROMPT='$(rvm_info_for_prompt) $(tput bel)' | |
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} " | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" |
NewerOlder