Skip to content

Instantly share code, notes, and snippets.

View berkus's full-sized avatar
🪢
~consume.enhance.replicate~

Berkus Decker berkus

🪢
~consume.enhance.replicate~
View GitHub Profile
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active January 19, 2026 13:00
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@msehnout
msehnout / main.rs
Last active November 2, 2017 13:45
C++17 Coding Challenge in Rust
/*
* # C++17 Coding challenge in Rust
* How to deal with edge cases:
* * if the input file is empty, the program should write “input file missing” to the console.
* * if the input file does not contain the specified column, the program should write “column name doesn’t exists in the input file” to the console.
*
* The rest was not considered and mercilessly unwrapped.
*/
use std::env;
@steveklabnik
steveklabnik / main.rs
Created October 25, 2017 16:06
The Results of the Expressive C++17 Coding Challenge in Rust
use std::env;
use std::io;
use std::io::prelude::*;
use std::fs::File;
#[derive(Debug)]
enum Error {
Io(io::Error),
Program(&'static str),
}
anonymous
anonymous / playground.rs
Created September 25, 2017 12:24
Rust code shared from the playground
//[dependencies]
//time = "0.1"
//futures = "0.1.14"
//tokio-core = "0.1"
//tokio-periodic = "0.1"
#[macro_use]
extern crate tokio_core;
extern crate time;
@gravitylow
gravitylow / codesign_gdb.md
Last active March 10, 2025 16:38 — forked from hlissner/codesign_gdb.md
Codesign gdb on macOS

If you are getting this in gdb on macOS while trying to run a program:

Unable to find Mach task port for process-id 57573: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))
  1. Open Keychain Access
  2. In menu, open Keychain Access > Certificate Assistant > Create a certificate
  3. Give it a name (e.g. gdbc)
@andywer
andywer / talk-proposal.md
Last active December 23, 2020 17:22
Reactive Conf 2017 ⚡️ Talk Proposal - Memory Leak Hunt 2017 Style

This is a proposal for lightning talk at Reactive Conf. Please 🌟 this gist to push the proposal!

Memory Leak Testing in 2017

Hi, I am Andy, creator of leakage - the node-powered memory leak testing library.

Instead of manual debugging it provides a structured approach to fix or even prevent memory leaks.

@mojavelinux
mojavelinux / jekyll-asciidoctor-diagram.adoc
Last active November 26, 2022 13:06
How to configure Asciidoctor Diagram in a Jekyll site

How to configure Asciidoctor Diagram in a Jekyll site

Generate site

$ cd /tmp
$ mkdir jekyll-site-creator
@DarinM223
DarinM223 / rustfmt.toml
Created May 3, 2017 04:24
A saner rustfmt configuration file
array_layout = "Visual"
chain_indent = "Block"
array_width = 80
chain_one_line_max = 80
comment_width = 80
condense_wildcard_suffices = false
closure_block_indent_threshold = 2
control_brace_style = "AlwaysSameLine"
disable_all_formatting = false
error_on_line_overflow = true