Skip to content

Instantly share code, notes, and snippets.

View djhworld's full-sized avatar

Daniel Harper djhworld

View GitHub Profile

Keybase proof

I hereby claim:

  • I am djhworld on github.
  • I am djhworld (https://keybase.io/djhworld) on keybase.
  • I have a public key ASBuDsFo40OPjQUbBHDIr1dXS_7QOXG7NGajhjKYUIzVnQo

To claim this, I am signing this object:

package main
import (
"bufio"
"fmt"
"os"
)
type Counter struct {
uniqueItems map[string]int
@djhworld
djhworld / count.rs
Created December 30, 2018 10:55
improved version
use std::collections::HashMap;
use std::io;
use std::io::BufRead;
struct Counter {
items: HashMap<String, usize>,
}
impl Counter {
fn new() -> Counter {
#!/bin/bash
# could probably get this to work with GNU grep but using ripgrep for now
check=$(cat /proc/acpi/wakeup | /usr/bin/rg XHC1 | /usr/bin/rg disabled)
if [[ $check == '' ]]; then
echo "Wakeup from XHC1 is enabled - disabling!"
echo XHC1 > /proc/acpi/wakeup
else