Skip to content

Instantly share code, notes, and snippets.

View HouCoder's full-sized avatar
🎯
Focusing

Tonni HouCoder

🎯
Focusing
View GitHub Profile
@HouCoder
HouCoder / duckdns.sh
Created March 12, 2020 02:56
DuckDNS record updater
#!/bin/bash
domain="duckdns.org"
name="example-a-record"
token="your token"
# Get public IP from ipinfo.io
public_ip="$(curl --silent ipinfo.io/ip)"
# get current record
current_record="$(dig @8.8.8.8 +short $name.$domain)"
@HouCoder
HouCoder / godaddy-dns-updater
Last active June 9, 2021 22:25
Godaddy DNS record updater.
#!/bin/bash
# https://developer.godaddy.com/keys
KEY=""
SECRET=""
domain="example.com"
name="a-record"
# Get public IP from ipinfo.io
public_ip="$(curl --silent ipinfo.io/ip)"
@HouCoder
HouCoder / youtube-dl.sh
Last active March 2, 2022 16:37
A shell script for automatic downloading your YouTube playlist.
#!/bin/bash
# Use $ which youtube-dl to get the path.
youtube_dl_path=/usr/local/bin/youtube-dl
# https://askubuntu.com/a/157787
if ps aux | grep -v grep | grep $youtube_dl_path > /dev/null
then
echo "youtube-dl is running"
exit 1
@HouCoder
HouCoder / eloquent-cheatsheet.php
Created June 13, 2016 10:23 — forked from hassansin/eloquent-cheatsheet.php
Laravel 5 Eloquent CheatSheet #laravel #eloquent
Model::
/*Select*/
select('col1','col2')
->select(array('col1','col2'))
->select(DB::raw('businesses.*, COUNT(reviews.id) as no_of_ratings, IFNULL(sum(reviews.score),0) as rating'))
->addSelect('col3','col4')
->distinct() // distinct select
/*From*/

BEMIT cheatsheet

source: http://csswizardry.com/2015/03/more-transparent-ui-code-with-namespaces/

  • o-: [Object][object]
    • Objects are abstract.
    • They can be used in any number of places (places you might not have seen).
    • Avoid modifying their styles.
    • Be careful around anything with a leading o-.
  • Examples: layout, wrappers, containers and other structural components
@HouCoder
HouCoder / gvimrc
Created August 15, 2014 16:43
Gvim config
set guifont=Consolas:h12
set linespace=4
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab
set noswapfile
set backspace=start,indent,eol
set numberwidth=4
set autoindent
@HouCoder
HouCoder / .tmux.config
Last active April 21, 2016 06:14
My Tmux config, save it to ~/.tmux.conf.
# 前置按键(bind-key)为Ctrl+b
# 一些基础的命令:
# list all sessions: tmux ls
# create a session: tmux new -s [new-session-name]
# attach to a session: tmux a -t [session-name]
# switch Sessions: tmux switch -t [session-name]
# 一些基础的快捷键
# bind-key ( 上一个Session