Skip to content

Instantly share code, notes, and snippets.

View parano's full-sized avatar
🍱

Chaoyu parano

🍱
View GitHub Profile
@parano
parano / gist:1868242
Created February 20, 2012 07:18
Excel表格密码保护的解除方法
表格受密码保护时,我们修改数据Excel弹出“您试图更改的单元格或图表受保护,因而是只读的。
若要修改受保护单元格或图表,请先使用‘撤消工作表保护’命令(在‘审阅’选项卡的‘更改’组中)来取消保护。
可能会提示输入密码。这时候我们可以用VBA宏代码破解法来破解表格保护密码:
第一步:打开该文件,先解除默认的“宏禁用”状态,方法是点击工具栏下的“选项”状态按钮,
打开“Microsoft Office安全选项”窗口,选择其中的“启用此内容”,“确定”
再切换到“视图”选项卡,点击“宏”→“录制宏”,出现“录制新宏”窗口,在“宏名”定义一个名称为:
PasswordBreaker,点击“确定”退出;
第二步:再点击“宏”→“查看宏”,选择“宏名”下的“PasswordBreaker”并点击“编辑”,
打开“Microsoft Visual Basic”编辑器,用如下内容替换右侧窗口中的所有代码:
@parano
parano / lookup.scpt
Last active May 10, 2023 18:41
Mac OS Quick Action: Lookup selected word in Google Translate
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
apiVersion: serving.yatai.ai/v1alpha2
kind: BentoDeployment
metadata:
name: demo
spec:
bento_tag: iris_classifier:3oevmqfvnkvwvuqj
resources:
limits:
cpu: 1000m
requests:
@parano
parano / Get notified when certain topics are being discussed on Hacker News.md
Last active March 31, 2022 09:24
Get notified when certain topics are being discussed on Hacker News

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 / keybase.md
Created November 19, 2018 23:33
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:

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
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:9653676
Created March 19, 2014 23:19
Send random arrow keys using ruby, Mac OS X only
#!/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
#!/bin/ruby
require 'RMagick'
include Magick
animation = ImageList.new(*Dir["*.png"])
animation.delay = 10
animation.write("animated.gif")
@parano
parano / gist:9c7290220a230b82de37
Created April 19, 2013 04:59
use peterson method to implement semaphore
/*
* =====================================================================================
*
* Filename: mutex_semaphore.c
*
* Description: use peterson method to implement semaphore
*
* Version: 1.0
* Created: 04/16/2013 03:27:04 PM
* Revision: none