Skip to content

Instantly share code, notes, and snippets.

View behnam's full-sized avatar
🦊

Behnam Esfahbod behnam

🦊
View GitHub Profile
@behnam
behnam / snapshottest-enum.py
Last active November 16, 2018 00:35
snapshottest.sorted_dict.SortedDict only accepts string dict keys
import enum
import collections
import snapshottest
class Fruit(enum.Enum):
APPLE = 1
ORANGE = 2
test_value = {
@behnam
behnam / preeti.json
Created January 16, 2018 19:09
Preeti Encoding to Unicode Mapping (Based on https://github.com/Shuvayatra/preeti/blob/master/preeti.js)
{
"name": "Preeti",
"v": "1.0.1",
"char-map": {
"\u00f7": "\/",
"v": "\u0916",
"r": "\u091a",
"\"": "\u0942",
@behnam
behnam / gist:64484153914d862a2c75d57d15fc58e4
Created November 5, 2017 23:18
rust git grep utf8/utf16 allocations
~/code/rust/rust$ git grep '\[0; 2\]'
src/libcore/tests/char.rs: let mut buf = [0; 2];
src/libpanic_unwind/seh.rs: [0; 2]
src/librustc_apfloat/ieee.rs: let mut wide_sig = [0; 2];
src/librustc_data_structures/blake2b.rs: t: [0; 2],
src/libstd/sys/redox/pipe.rs: let mut fds = [0; 2];
src/libstd/sys/unix/pipe.rs: let mut fds = [0; 2];
src/libstd/sys_common/wtf8.rs: let mut buf = [0; 2];
src/libstd_unicode/char.rs: /// let mut b = [0; 2];
src/libstd_unicode/char.rs: /// let mut b = [0; 2];
@behnam
behnam / Cargo.lock-after.toml
Created July 15, 2017 22:09
Cargo.lock-after
[root]
name = "unicode-bidi"
version = "0.3.3"
dependencies = [
"flame 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_test 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
@behnam
behnam / Cargo.lock-before.toml
Created July 15, 2017 22:09
Cargo.lock-before
[root]
name = "unicode-bidi"
version = "0.3.3"
dependencies = [
"flame 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_test 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
@behnam
behnam / main.rs
Created July 7, 2017 22:07
glob vs globset
extern crate glob;
extern crate globset;
fn main() {
println!("\n## This is globset!");
let glob = globset::Glob::new("*.rs").unwrap().compile_matcher();
assert!(glob.is_match("foo.rs"));
assert!(glob.is_match("foo/bar.rs"));
@behnam
behnam / cargo-publish-all.sh
Created June 21, 2017 00:30
Rust/Cargo: Temporary solution to publishing all components of a super-crate
#!/usr/bin/env bash
# Copyright 2017 The UNIC Project Developers.
#
# See the COPYRIGHT file at the top-level directory of this distribution.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
@behnam
behnam / keybase.md
Created April 16, 2014 08:06
keybase.io

Keybase proof

I hereby claim:

  • I am behnam on github.
  • I am behnam (https://keybase.io/behnam) on keybase.
  • I have a public key whose fingerprint is 3E7F B4B6 6F4C A8AB 9BB9 7520 5701 CA40 259E 0F8B

To claim this, I am signing this object:

Google Glass XE7 was released this week. This time, Google also released a changelog of all the changes. However, I'm a reader of Ron Amadeo's APK Teardown series, and that column taught me to always hunt for hidden changes in updates.

So without further ado, I present:

#What's Really New: Glass XE7

Volume change

Google Glass XE7 was released this week. This time, Google also released a changelog of all the changes. However, I'm a reader of Ron Amadeo's APK Teardown series, and that column taught me to always hunt for hidden changes in updates.

So without further ado, I present:

#What's Really New: Glass XE7

Volume change