Skip to content

Instantly share code, notes, and snippets.

View nhdinh's full-sized avatar
💭
Out for running

Hung Dinh nhdinh

💭
Out for running
  • Vietnam
View GitHub Profile
@nhdinh
nhdinh / miniwol
Created October 15, 2023 15:01
wol
{
"time": 2000
}
@nhdinh
nhdinh / tampermonkey-testio-nhdinh.user.js
Last active October 2, 2023 04:25
Save data from testIO
// ==UserScript==
// @name IssueSaver
// @namespace https://gist.github.com/nhdinh/ed3e1f955d4d38574336ad0557ae088c
// @downloadURL https://gist.github.com/nhdinh/ed3e1f955d4d38574336ad0557ae088c/raw/tampermonkey-testio-nhdinh.user.js
// @updateURL https://gist.github.com/nhdinh/ed3e1f955d4d38574336ad0557ae088c/raw/tampermonkey-testio-nhdinh.user.js
// @version 0.1.6
// @description Save bugs into my Google Sheet!
// @author You
// @match https://platform.utest.com/testcycles/*/
// @icon https://www.google.com/s2/favicons?sz=64&domain=test.io
@nhdinh
nhdinh / tampermonkey-vpsdashboard-nhdinh.user.js
Last active September 28, 2023 01:34
tampermonkey-vsp.user.js
// ==UserScript==
// @name BangGiaVPS
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Clean the web interface of the dashboard
// @author You
// @match https://banggia.vps.com.vn/chung-khoan/danh-muc
// @icon https://www.google.com/s2/favicons?sz=64&domain=vps.com.vn
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js
// @grant none
@nhdinh
nhdinh / testio.proxy.pac
Last active October 6, 2023 03:13
PAC Script
function FindProxyForURL(url, host) {
// our local URLs from the domains below example.com don't need a proxy:
if (shExpMatch(host, "*..apartmentlist.me")) {
return "PROXY forward.test.io:3128";
}
// URLs within this network are accessed through
// port 8080 on fastproxy.example.com:
// if (isInNet(host, "10.0.0.0", "255.255.248.0")) {
// return "PROXY fastproxy.example.com:8080";
@nhdinh
nhdinh / all_unique.py
Created November 3, 2019 04:57
All unique
def all_unique(list):
return len(list) == len(set(list))
x = [1,2,3,4,5,6,7,8,9,10]
y = [1,1,2,3,4,5,6,6,7,8,9]
all_unique(x) # True
all_unique(y) # False
@nhdinh
nhdinh / wifi-on-ubuntu-server-18.md
Created July 6, 2019 04:47 — forked from austinjp/wifi-on-ubuntu-server-18.md
Enabling wifi on Ubuntu server 18

Wifi on Ubuntu 18 server

TLDR

  1. Install wpasupplicant
  2. Turn on wifi radios: sudo nmcli radio wifi on
  3. Check your devices are recognised even if they're not "managed": sudo iwconfig
  4. Check your wifi (here called "wlp3s0") is capable of detecting nearby routers: sudo iwlist wlp3s0 scan
  5. Configure netplan by dropping a file called 01-netcfg.yaml into /etc/netplan/ or edit existing file there. See example below.
  6. netplan try, netplan generate, netplan apply.
@nhdinh
nhdinh / capybara cheat sheet
Created September 14, 2016 12:50 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')