Skip to content

Instantly share code, notes, and snippets.

Avatar
☀️
Focusing

Chaoyu parano

☀️
Focusing
View GitHub Profile
@parano
parano / Get notified when certain topics are being discussed on Hacker News.md
Last active May 16, 2020
Get notified when certain topics are being discussed on Hacker News
View Get notified when certain topics are being discussed on Hacker News.md

Get notified when certain topics are being discussed on Hacker News

This is a simple solution I use for getting notifications on my phone, whenever there is discussion happening on Hacker News related to topics that I am interested in. The solution is relying on the @newsyc20 twitter bot(or @newsyc50, @newsyc100, ...), twitter advanced search query and ifttt.com.

Here's an example of how I made ifttt to send me a mobile notification when there's Machine Learning, MLops, BentoML, releated discussion on hacker news that has reached 20 points:

  1. Create a twitter search query that filters content posted by @newsyc20, here's the query I used: [ML OR AI OR mlops OR "machine learning" OR "artificial intelligence" OR "deep learning" OR "bentoml" from:newsyc20](https://twitter.com/search?q=ML%20OR%20AI%20OR%20mlops%20OR%20%22machine%20learning%22%20OR%20%22artificial%20intelligence%22%20OR%20%22deep%20learning%22%20OR%20%22bentoml%22%20from%3A
@parano
parano / lookup.scpt
Last active Feb 22, 2021
Mac OS Quick Action: Lookup selected word in Google Translate
View lookup.scpt
on run {input, parameters}
set phrase to input as string
set ui_lang to "en"
set from_lang to "auto"
set to_lang to "zh-CN"
set google_translate_url to "https://translate.google.com"
set google_translate_look_up_url to google_translate_url & "/?hl=" & ui_lang & "&sl=" & from_lang & "&tl=" & to_lang & "&text=" & phrase
View keybase.md

Keybase proof

I hereby claim:

  • I am parano on github.
  • I am parano (https://keybase.io/parano) on keybase.
  • I have a public key ASA7qOz0-eIXx7IQBf8qz9pkG95-zRyZxKyB6Pg0bzQEsAo

To claim this, I am signing this object:

View test2.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 7 columns, instead of 4. in line 6.
reporting`campaign,da😄te,gr'oup,cre*&ative,type,na^$%me,valu()e
Belsomra-Q1-2016,2016-02-08,desktop,Always Awake? | Get The Information You Need To | Help Aid Your Insomnia Symptoms. | www.help-treat-insomnia.com,metric,Clicks,0
Belsomra-Q1-2016,2016-02-08,desktop,Always Awake? | Get The Information You Need To | Help Aid Your Insomnia Symptoms. | www.help-treat-insomnia.com,metric,Impressions,15
Belsomra-Q1-2016,2016-02-08,desktop,Can't Sleep At Night? | Find Answers To Common Questions & | Learn About A Treatment Option Here | www.help-treat-insomnia.com,metric,Clicks,0
Belsomra-Q1-2016,2016-02-08,desktop,Can't Sleep At Night? | Find Answers To Common Questions & | Learn About A Treatment Option Here | www.help-treat-insomnia.com,metric,Impressions,6
Belsomra-Q1-2016,2016-02-08,desktop,Can't Sleep At Night? | Find Information About Insomnia | & A Treatment Option Today. | www.help-treat-insomnia.com,metric,Clicks,0
Belsomra-Q1-2016,2016-02-08,desktop,Can't Sleep At Night? | Find Information Abou
View test.csv
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 7 columns, instead of 4. in line 6.
reporting_campaign,da😄te,group,cre*&ative,type,na^$%me,valu()e
Belsomra-Q1-2016,2016-02-08,desktop,Always Awake? | Get The Information You Need To | Help Aid Your Insomnia Symptoms. | www.help-treat-insomnia.com,metric,Clicks,0
Belsomra-Q1-2016,2016-02-08,desktop,Always Awake? | Get The Information You Need To | Help Aid Your Insomnia Symptoms. | www.help-treat-insomnia.com,metric,Impressions,15
Belsomra-Q1-2016,2016-02-08,desktop,Can't Sleep At Night? | Find Answers To Common Questions & | Learn About A Treatment Option Here | www.help-treat-insomnia.com,metric,Clicks,0
Belsomra-Q1-2016,2016-02-08,desktop,Can't Sleep At Night? | Find Answers To Common Questions & | Learn About A Treatment Option Here | www.help-treat-insomnia.com,metric,Impressions,6
Belsomra-Q1-2016,2016-02-08,desktop,Can't Sleep At Night? | Find Information About Insomnia | & A Treatment Option Today. | www.help-treat-insomnia.com,metric,Clicks,0
Belsomra-Q1-2016,2016-02-08,desktop,Can't Sleep At Night? | Find Information About
@parano
parano / gist:3ccaeeb5974564f8132d
Last active Aug 29, 2015
Ruby on Rails Controller - Allow Origin Header
View gist:3ccaeeb5974564f8132d
class ApplicationController < ActionController::Base
before_filter :cors_set_access_control_header
# other staff
private
def cors_set_access_control_header
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, PUT, DELETE, GET, OPTIONS'
headers['Access-Control-Request-Method'] = '*'
@parano
parano / gist:10683720
Created Apr 14, 2014
Recursively delete all the '.DS_Store' files under current folder and its sub-folders
View gist:10683720
sudo find ./ -name ".DS_Store" -depth -exec rm -f {} \;
@parano
parano / gist:9653676
Created Mar 19, 2014
Send random arrow keys using ruby, Mac OS X only
View gist:9653676
#!/usr/bin/ruby -w
def presskey(keycode)
system "osascript -e 'tell application \"System Events\" to key code #{keycode}'"
end
kVK_LeftArrow = 123
kVK_RightArrow = 124
kVK_DownArrow = 125
kVK_UpArrow = 126
@parano
parano / gist:9518893
Created Mar 12, 2014
Sending Keystrokes to OS X via osascript, in Ruby
View gist:9518893
#!/usr/bin/ruby -w
def presskey(keycode)
system "osascript -e 'tell application \"System Events\" to key code #{keycode}'"
end
kVK_LeftArrow = 123
kVK_RightArrow = 124
kVK_DownArrow = 125
kVK_UpArrow = 126
View create gif from pictures
#!/bin/ruby
require 'RMagick'
include Magick
animation = ImageList.new(*Dir["*.png"])
animation.delay = 10
animation.write("animated.gif")