- GitHub Staff
- https://fjcasas.es
- @nflamel@hachyderm.io
View Makefile
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
# Build the test command allowing to overwrite some of the options. | |
TEST_FLAGS?=-v -race -count 1 -timeout 3s | |
TEST_ARGS?=./... | |
GO_TEST=go test $(TEST_FLAGS) | |
.PHONY: test | |
test: | |
$(GO_TEST) $(TEST_ARGS) |
View main.rs
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
// This is not at all like tail. Will fail in many scenarios but it was funny to write it :) | |
use std::fs::File; | |
use std::io::prelude::*; | |
use std::io::{BufReader, SeekFrom}; | |
use std::thread::sleep; | |
use std::time::Duration; | |
fn main() { | |
let file_name = "some_file.log"; | |
let file = File::open(file_name.clone()).unwrap(); |
View gist:63004b5eb919e9ef018a0954d07ea622
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
irb(main):001:0> h = Hash.new([]) | |
=> {} | |
irb(main):002:0> h[:hello] << :fran | |
=> [:fran] | |
irb(main):003:0> h[:hallo] << :andreas | |
=> [:fran, :andreas] | |
irb(main):004:0> h | |
=> {} | |
irb(main):005:0> h[:asdf] | |
=> [:fran, :andreas] |
View traefik.config.toml
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
# Config for a dev app with rails + webpacker | |
[http] | |
[http.routers] | |
[http.routers.https-to-webpack-dev-server] | |
rule = "Host(`domain.dev`) && PathPrefix(`/sockjs-node`)" | |
service = "webpack-dev-server" | |
entrypoints = ["https"] | |
priority = 2 | |
[http.routers.https-to-webpack-dev-server.tls] |
View docker-compose.yml
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
version: '3' | |
services: | |
proxy: | |
image: traefik:v2.0 # The official Traefik docker image | |
network_mode: host # Allows traefik to talk to your host machine | |
ports: | |
- "80:80" | |
- "443:443" | |
- "8080:8080" # The Web UI | |
volumes: |
View no_focus.rb
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
# If a spec in the suite is marked with focus on the CI it will fail. | |
RSpec::Matchers.define :have_no_focus do | |
match { |ex| !ex.metadata[:focus] } | |
failure_message(&:inspect) | |
end | |
RSpec.configure do |config| | |
config.before(:each) do |example| |
View fira-code.conf
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
<!-- ~/.config/fontconfig/fira-code.conf --> | |
<?xml version="1.0"?> | |
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | |
<fontconfig> | |
<match target="pattern"> | |
<test qual="any" name="family"><string>monospace</string></test> | |
<edit name="family" mode="assign" binding="same"><string>Fira Code</string></edit> | |
</match> | |
</fontconfig> |
View example.ex
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
content = """ | |
hello! | |
""" | |
assert content == "hello!\n" | |
content = """ | |
hello!\ | |
""" |
View unicodeces.vim
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
" A couple of nice things your vim can use when you're dealing with unicode text. | |
" Taken from https://stackoverflow.com/questions/16987362/how-to-get-vim-to-highlight-non-ascii-characters | |
" Highlight all non ascii characters | |
syntax match nonascii "[^\x00-\xFF]" | |
highlight nonascii guibg=Red ctermbg=2 | |
" Find any non ascii character | |
nnoremap <leader>na /[^\x00-\xFF]<CR> |
View list-resolution.sh
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
for file in *.png; do identify $file | awk '{print $1, $3}'; done |
NewerOlder