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
From 48433f6b5b56fdee0f3c8172e7edba331235d999 Mon Sep 17 00:00:00 2001 | |
From: Justin Weiss <[email protected]> | |
Date: Thu, 21 Mar 2024 20:50:56 -0700 | |
Subject: [PATCH] oxp-sensors: hwmon: Add GPD Win Mini | |
Adds the GPD Win Mini handheld to PWM fan control. The Win Mini | |
has a register for reading fan speed and a register for reading and | |
writing the PWM. It does not have a separate enable register, but | |
treats writing 0 to the PWM as fan auto mode. Values from 1-244 set a | |
manual fan speed, and 245-255 have undetermined behavior. |
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
From 3f6507504828019e2812df1d7930d782e2ddeb23 Mon Sep 17 00:00:00 2001 | |
From: Justin Weiss <[email protected]> | |
Date: Tue, 13 Feb 2024 21:28:09 -0800 | |
Subject: [PATCH] iio: imu: Add driver for Bosch BMI260 IMU | |
The ultra-low power BMI260 is an IMU consisting of a 16-bit tri-axial | |
gyroscope and a 16-bit tri-axial accelerometer combining precise | |
acceleration, angular rate measurement and intelligent on-chip | |
motion-triggered interrupt features. |
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
#!/usr/bin/env ruby | |
require "json" | |
require "optparse" | |
$options = {} | |
def system!(*args) | |
puts "> #{args.join(" ")}" | |
system(*args) || raise("Error running #{args.join(" ")}: #{$?} ") |
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
# We'll start by inheriting from a BasicObject, with our two properties: state and behavior. | |
class TinyObject < BasicObject | |
attr_accessor :state | |
attr_accessor :behavior | |
end | |
# `add_method`, for adding a method implementation to a behavior / class's state. | |
behavior_add_method = lambda do |behavior, method_name, method| | |
behavior.state[:methods][method_name] = method |
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
### Keybase proof | |
I hereby claim: | |
* I am justinweiss on github. | |
* I am justinweiss (https://keybase.io/justinweiss) on keybase. | |
* I have a public key whose fingerprint is 6FF0 E872 CACA 2A9A 8942 95E3 08F4 4018 35C2 8D55 | |
To claim this, I am signing this object: |
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
require 'yaml' | |
require 'erb' | |
require 'ostruct' | |
class Settings < OpenStruct | |
# Settings.new(:google_analytics) | |
def initialize(config_file_base_name) | |
super(YAML.load(ERB.new(File.read(Rails.root.join("config", "#{config_file_base_name}.yml"))).result)[Rails.env]) | |
end |
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
# Call scopes directly from your URL params: | |
# | |
# @products = Product.filter(params.slice(:status, :location, :starts_with)) | |
module Filterable | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Call the class methods with names based on the keys in <tt>filtering_params</tt> | |
# with their associated values. For example, "{ status: 'delayed' }" would call |
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
module HashExtensions | |
def string_merge(other, separator = " ") | |
merge(other) {|key, old, new| old.to_s + separator + new.to_s} | |
end | |
end | |
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
/* Picked up from Help search on Key Bindings. Good stuff -shane */ | |
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */ | |
{ | |
"~f"="moveWordForward:"; | |
"~b"="moveWordBackward:"; | |
"~<"="moveToBeginningOfDocument:"; | |
"~>"="moveToEndOfDocument:"; | |
"~v"="pageUp:"; | |
"~d"="deleteWordForward:"; | |
"~^h"="deleteWordBackward:"; |
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
def book_with_endorsements(endorsement_count) | |
book = Factory(:book) | |
endorsement_count.times do |n| | |
Factory(:endorsement, :book_id => book.id) | |
end | |
book | |
end |
NewerOlder