Skip to content

Instantly share code, notes, and snippets.

View h6y3's full-sized avatar

Han Yuan h6y3

View GitHub Profile
@h6y3
h6y3 / enophone_afterlife.md
Last active August 12, 2024 16:05
Enophone login workaround and client download

Enophone login workaround and client download

If you have found this link, then you know what this. I was fortunate to reach the founders on the Internet to ascertain ways in which those who of us who have working headset can still continue to use the device now that the servers have been deprovisioned.

First, if you do not have the latest client, I have secured the clients and hosted them on Mediafire here:

@h6y3
h6y3 / md_slack.rb
Last active May 26, 2023 08:55
Obsidian Markdown to Slack
#!/usr/bin/env ruby
filename = "/Users/hyuan/Development/bin/tmp/tmp_slack_md.txt"
file = File.open(filename)
file_data = file.read
# Upper case title
re = /^#* .+/
file_data.gsub!(re) { |match| "*#{match.upcase}*"}
@h6y3
h6y3 / Meeting Template.md
Created July 25, 2021 00:57
Templater/Obsidian Date-Based Router with Meeting Notes Use Case

<%+ tp.file.title %>

Date: <% tp.date.now("YYYY-MM-DD") %> Time: <% tp.date.now("HH:mm") %> Who: Last modified date: <%+ tp.file.last_modified_date() %>

Notes

@h6y3
h6y3 / rpi-lcd.sh
Last active May 17, 2017 13:30
Ruby script to turn Raspberry Pi 7" LCD on or off
#!/usr/bin/ruby
# Example usage: ./rpi-lcd.sh --power=on
args = Hash[ ARGV.join(' ').scan(/--?([^=\s]+)(?:=(\S+))?/) ]
power = args["power"]
if power == "on"
%x(sudo bash -c "echo 0 > /sys/class/backlight/rpi_backlight/bl_power")
elsif power == "off"
%x(sudo bash -c "echo 1 > /sys/class/backlight/rpi_backlight/bl_power")
end
@h6y3
h6y3 / MyController.rb
Created October 26, 2012 22:12
teacup handlers being called 8 times for a single layout
class MyController < UIViewController
stylesheet :my_controller
layout :root do
subview(UITextField, :field)
end
def shouldAutorotateToInterfaceOrientation(orientation)
autorotateToOrientation(orientation)
end
@h6y3
h6y3 / objective-c.m
Created October 24, 2012 18:59
print ios font names and families rubymotion style
for (NSString *familyName in [UIFont familyNames] )
{
NSLog(@"Family name: %@", familyName);
for (NSString *fontName in [UIFont fontNamesForFamilyName:
familyName])
{
NSLog(@" Font name: %@", fontName);
}
}
@h6y3
h6y3 / Gemfile
Created October 9, 2012 13:37 — forked from simeonwillbanks/Gemfile
rails 3, rspec-rails, capybara, capybara-webkit, headless in order to run request specs that can test javascript
source 'https://rubygems.org'
gem 'rails', '3.2.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'