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
#![allow(dead_code)] | |
// playground: https://gist.github.com/rust-play/6d697a29901d4b82cc8b184526d4b8f1 | |
fn all_postfixes_sorted(arr: &[&str]) -> Vec<String> { | |
let mut postfixes: std::collections::HashSet<String> = std::collections::HashSet::new(); | |
for &w in arr { | |
for start_idx in 0..(w.chars().count()) { | |
let slice: &str = &w[start_idx..]; | |
let w = String::from(slice); |
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
#![allow(dead_code)] | |
// https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=bda017580640d3b70ea211bec7e9038b | |
// Task: sorted postfixes for given list of strings | |
// Example: bcd -> bcd,cd,d | |
// Example: abc,bcd,xyz -> abc,bc,bcd,c,cd,d,xyz,yz,z | |
fn all_postfixes_sorted(arr: &[&str]) -> Vec<String> { | |
let mut postfixes: std::collections::HashSet<String> = std::collections::HashSet::new(); | |
for &w in arr { |
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.8" | |
services: | |
chrome: | |
network_mode: "host" | |
image: jess/chrome | |
environment: | |
DISPLAY: 'unix:0' | |
volumes: | |
- /run/dbus/system_bus_socket:/run/dbus/system_bus_socket |
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
// | |
// Example: Hello World! | |
// | |
// This is an example UEFI application that prints "Hello World!", then waits for key input before | |
// it exits. It serves as base example how to write UEFI applications without any helper modules | |
// other than the UEFI protocol definitions. | |
// | |
// The `efi_main` function serves as entry-point. Depending on your target-configuration, this | |
// entry point might be called differently. If you use the target-configuration shipped with | |
// r-efi, then `efi_main` is the selected PE/COFF entry point. |
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 | |
# | |
# Change the commit and/or author date of git commits. | |
# | |
# change-date [-f] commit-to-change [branch-to-rewrite [commit-date [author-date]]] | |
# | |
# If -f is supplied it is passed to "git filter-branch". | |
# | |
# If <branch-to-rewrite> is not provided or is empty HEAD will be used. |
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
function dockershell() { | |
docker run --rm -i -t --entrypoint=/bin/bash "$@" | |
} | |
function dockershellsh() { | |
docker run --rm -i -t --entrypoint=/bin/sh "$@" | |
} | |
function dockershellhere() { | |
dirname=${PWD##*/} |
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
use std::time::{ Instant, Duration }; | |
fn benchmark<F: FnOnce()>(f: F) { | |
let t0 = Instant::now(); | |
f(); | |
let t1 = Instant::now(); | |
let dt = t1 - t0; | |
println!("{}", dt.as_millis()); | |
} |
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
@prefix dc: <http://purl.org/dc/elements/1.1/>. | |
@prefix ex: <http://example.org/stuff/1.0/> . | |
@prefix foaf: <http://xmlns.com/foaf/0.1/>. | |
@prefix owl: <http://www.w3.org/2002/07/owl#>. | |
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. | |
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. | |
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#>. | |
@prefix wot: <http://xmlns.com/wot/0.1/>. | |
@prefix xml: <http://www.w3.org/XML/1998/namespace>. | |
@prefix xsd: <http://www.w3.org/2001/XMLSchema#>. |
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
pi@raspberrypi ~ $ cat /etc/init/ssh_tunnel.conf | |
#!upstart | |
author "george" | |
description "SSH Tunnel" | |
start on stopped rc | |
stop on shutdown |
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
.block-children { | |
border-left-width: var(--ls-block-bullet-threading-width); | |
} | |
.block-content-wrapper { | |
position: relative; | |
} | |
.bullet-container { | |
height: 14px !important; |