Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Tonni HouCoder

🎯
Focusing
View GitHub Profile
@HouCoder
HouCoder / duckdns.sh
Created Mar 12, 2020
DuckDNS record updater
View duckdns.sh
#!/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 Dec 11, 2020
Godaddy DNS record updater.
View godaddy-dns-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 Nov 5, 2020
A shell script for automatic downloading your YouTube playlist.
View youtube-dl.sh
#!/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 Jun 13, 2016 — forked from hassansin/eloquent-cheatsheet.php
Laravel 5 Eloquent CheatSheet #laravel #eloquent
View eloquent-cheatsheet.php
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*/
View cheatsheet-bemit.md

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
View gvimrc
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 Apr 21, 2016
My Tmux config, save it to ~/.tmux.conf.
View .tmux.config
# 前置按键(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