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
#Rewrites the request, extracting a fragment of the file name and using a remote server. | |
location @fetchFromRemote { | |
rewrite ^/path/to/images/(.*)$ http://remoteserver.com/other/path/to/images/$1 redirect; | |
} | |
#Will try to see if we have the file in this server, is not will use fetchFromRemote | |
location ~ ^/path/to/images/.*(png|jpg|jpeg|gif|ico|swf)$ { | |
try_files $uri @fetchFromRemote; | |
} |
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
#[link(name = "logger")] | |
extern { | |
fn CrystalLog(text: *const u8); | |
} | |
fn log(text: &'static str) { | |
unsafe{ CrystalLog(text.as_bytes().as_ptr()) }; | |
} | |
fn main() { |
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
#!/usr/bin/env sh | |
sudo update-alternatives --install \ | |
/usr/bin/llvm-config llvm-config /usr/bin/llvm-config-3.4 200 \ | |
--slave /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-3.4 \ | |
--slave /usr/bin/llvm-as llvm-as /usr/bin/llvm-as-3.4 \ | |
--slave /usr/bin/llvm-bcanalyzer llvm-bcanalyzer /usr/bin/llvm-bcanalyzer-3.4 \ | |
--slave /usr/bin/llvm-cov llvm-cov /usr/bin/llvm-cov-3.4 \ | |
--slave /usr/bin/llvm-diff llvm-diff /usr/bin/llvm-diff-3.4 \ | |
--slave /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-3.4 \ |
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
#!/usr/bin/env bash | |
# ------------------------------------------------------------------------- | |
# - | |
# Created by Fonic (https://github.com/fonic) - | |
# Date: 12/29/19 - 02/12/20 - | |
# - | |
# Created for and tested on single-GPU system equipped with NVIDIA - | |
# GeForce RTX 2060 SUPER. For other systems, modifications might be - | |
# required. - |
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
#!/usr/bin/python | |
import random | |
import unicodedata | |
def unicode_fuzz(lower_limit=0, upper_limit=60): | |
unicode_glyphs = ''.join( | |
unichr(char) | |
for char in xrange(65533) | |
# use the unicode categories that don't include control codes |
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
{ | |
viewer { | |
repositories(privacy: PUBLIC, first: 3, orderBy: {field: PUSHED_AT, direction: DESC}) { | |
nodes { | |
nameWithOwner | |
url | |
} | |
} | |
} | |
} |
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
require "option_parser" | |
require "http/server" | |
require "json" | |
class Settings | |
property port = 3000 | |
property host = "127.0.0.1" | |
property? show_headers = false | |
property? show_raw_json = false | |
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
# URI of the local (caching) HTTP proxy | |
LOCAL_HTTP_PROXY = 'http://192.168.33.200:8123' | |
# Configures vagrant-cachier and vagrant-proxyconf. | |
# Should be called only on "local machine" providers. | |
def configure_caching(config) | |
if Vagrant.has_plugin?('vagrant-cachier') | |
config.cache.enable_nfs = true | |
config.cache.enable :gem | |
config.cache.enable :npm |
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/bash | |
### | |
### my-script — does one thing well | |
### | |
### Usage: | |
### my-script <input> <output> | |
### | |
### Options: | |
### <input> Input file to read. | |
### <output> Output file to write. Use '-' for stdout. |
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
data = [{"Brian", 42}, {"Alan", 30}, {"Brian", 32}] | |
# unstable | |
data.sort_by &.[0] # => [{"Brian", 42}, {"Alan", 30}, {"Brian", 32}] | |
# stable | |
data.map_with_index { |d,i| {d,i} }.sort_by { |di| {di[0][0], di[1]} }.map { |di| di[0] } # => [{"Alan", 30}, {"Brian", 42}, {"Brian", 32}] |