Skip to content

Instantly share code, notes, and snippets.

View wezm's full-sized avatar

Wesley Moore wezm

View GitHub Profile
diff --git a/PKGBUILD b/PKGBUILD
index e890744..224afed 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,6 +7,7 @@ arch=('i686' 'x86_64')
url="https://github.com/tummychow/git-absorb"
license=('BSD')
depends=(
+ 'libgit2'
)
@wezm
wezm / x86_64-unknown-linux-gnu-binsize.log
Created January 19, 2019 22:09
impact of rust 1.32.0 removing jemalloc infavor of default system allocator (x86_64-unknown-linux-gnu)
 rustc --version
rustc 1.31.1 (b6c32da9b 2018-12-18)
 cat src/main.rs
fn main() {
println!("Hello, world!");
}
 cargo build
Compiling binsize v0.1.0 (/tmp/binsize)
Finished dev [unoptimized + debuginfo] target(s) in 0.81s
 du -h target/debug/binsize
@wezm
wezm / xps.md
Created August 10, 2018 22:54
Hardware support on Dell XPS 15 9560 with OpenBSD
  • Ethernet: N/A
  • Wifi: No (had to use USB WiFi dongle)
  • Video: Yes
  • HDMI: Don't know
  • ZZZ: No, did not hibernate, hung
  • zzz: Yes. Suspended and resumed properly. Had to manually run netstart to start network after resuming.
  • Headphones: No sound
  • Mic: No
  • Speakers: No sound
  • LCD backlight: Yes (but only at 100%)
@wezm
wezm / activitypub.rs
Last active December 21, 2017 14:17
An attempt at representing ActivityPub in Rust
use std::collections::HashMap;
use serde::ser::{Serialize, SerializeStruct};
#[derive(Default)]
pub struct Object {
pub context: Context,
pub id: String,
// type to be defined by sub-type? Or have a big enum for it?
pub attachment: Option<String>,
@wezm
wezm / org.albert.extension.websearch.json
Created January 30, 2017 20:07
Albert websearch config
[
{
"enabled": false,
"iconPath": ":google",
"name": "Google",
"trigger": "gg ",
"url": "https://www.google.com/search?q=%s"
},
{
"enabled": false,
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
#name of package
test "$PKG_NAME" || PKG_NAME=Package
test "$srcdir" || srcdir=.
# default version requirements ...
test "$REQUIRED_AUTOMAKE_VERSION" || REQUIRED_AUTOMAKE_VERSION=1.11.2
test "$REQUIRED_AUTORECONF_VERSION" || REQUIRED_AUTORECONF_VERSION=2.53
@wezm
wezm / vim.zsh
Created September 20, 2015 03:00
Zsh function to extract line number from a path and open the file in vim at that line
# This will open files at the specified line in vim if the last argument
# matches filename:line. E.g. app/models/user.rb:123
function v() {
last_arg="${@: -1}"
parts=("${(s/:/)last_arg}")
file=$parts[1]
line_number=$parts[2]
if [[ $line_number -gt 0 ]]; then
@wezm
wezm / private.xml
Last active August 29, 2015 14:23
Karabiner Slack Customisation
<?xml version="1.0"?>
<root>
<appdef>
<appname>SLACK</appname>
<equal>com.tinyspeck.slackmacgap</equal>
</appdef>
<item>
<name>Slack Customisation</name>
require 'active_support/core_ext/array'
items = ["African", "Ambient", "Asian", "Avant-garde", "Blues", "Breakbeat", "Caribbean", "Comedy", "Country", "Disco", "Downtempo", "Drum & Bass", "Easy listening", "Electro", "Electronic", "Folk", "Hardcore", "Hardstyle", "Hip hop", "House", "Industrial", "Jazz", "Jungle", "Latin", "Pop", "R&B", "Rock", "Soul", "Techno", "Trance"]
letters = ('a'..'z')
puts letters.to_a.map(&:upcase).join(' ')
last_letter = '`' # ` is the char before 'a'
items.in_groups_of(2).each do |group|
next_letter = group.compact.map { |item| item[0].downcase }.last
@wezm
wezm / README.md
Created May 1, 2015 03:48
Generate listing

Listing

How would you go about generating a page like this in Rails?

screenshot

Each of the letters at the top of the page is a link to #a, #b, etc. Above each row <a name="a"></a> tags need to be added for all the letters that occur between the previous row and this row.

Here is a sample array: