Skip to content

Instantly share code, notes, and snippets.

View BbsonLin's full-sized avatar
🏚️
Working...

Bobson Lin BbsonLin

🏚️
Working...
View GitHub Profile
@mitgr81
mitgr81 / Output
Last active October 6, 2017 07:15 — forked from DazWorrall/Output
in upload handler
in file close
..
----------------------------------------------------------------------
Ran 2 tests in 0.021s
OK
@blackfalcon
blackfalcon / git-feature-workflow.md
Last active November 5, 2024 19:53
Git basics - a general workflow

Git-workflow vs feature branching

When working with Git, there are two prevailing workflows are Git workflow and feature branches. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited, and the focus of this article.

If you are new to Git and Git-workflows, I suggest reading the atlassian.com Git Workflow article in addition to this as there is more detail there than presented here.

I admit, using Bash in the command line with the standard configuration leaves a bit to be desired when it comes to awareness of state. A tool that I suggest using follows these instructions on setting up GIT Bash autocompletion. This tool will assist you to better visualize the state of a branc

@Apsu
Apsu / input.txt
Last active April 10, 2023 01:48
/etc/network/interfaces parser
# Comment lo
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 162.242.220.169
gateway 162.242.220.1
netmask 255.255.255.0
@SuryaSankar
SuryaSankar / M2M_Association_SQLalchemy.py
Last active September 25, 2023 07:30
An example of a many to many relation via Association Object in SQLAlchemy
import sqlalchemy
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import sessionmaker, relationship, backref
from sqlalchemy.ext.associationproxy import association_proxy
import uuid
engine = sqlalchemy.create_engine('sqlite:///:memory:')
Base = declarative_base()
@jottr
jottr / readline_shortcuts.md
Last active October 20, 2024 17:08
readline shortcuts

Readline

GNU readline is a commonly used library for line-editing; it is used for example by Bash, FTP, and many more (see the details of [readline][5] package under "Required By" for more examples). readline is also customizable (see man page for details).

Keyboard Shortcut Description

Ctrl+l Clear the screen

Cursor Movement

@jarrekk
jarrekk / jsonp-in-flask.py
Last active June 22, 2020 13:41 — forked from farazdagi/jsonp-in-flask.py
JSONP in Flask
from functools import wraps
from flask import request, current_app, jsonify, Flask
app = Flask(__name__)
def jsonp(f):
"""Wraps JSONified output for JSONP"""
@wraps(f)
@mihow
mihow / load_dotenv.sh
Last active October 22, 2024 08:26
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@enzinier
enzinier / install_font_adobe_source_code_pro.sh
Created March 4, 2017 03:38
Install font Adobe Source Code Pro on Ubuntu 16.04 LTS
#!/bin/sh
# Userland mode (~$USER/), (~/).
# ~/.fonts is now deprecated and that
#FONT_HOME=~/.fonts
# ~/.local/share/fonts should be used instead
FONT_HOME=~/.local/share/fonts
echo "installing fonts at $PWD to $FONT_HOME"
mkdir -p "$FONT_HOME/adobe-fonts/source-code-pro"
@appleboy
appleboy / gitea_install.md
Last active January 20, 2024 09:48
how to install gitea in Ubuntu/Debian.

Gitea

Gitea is a painless self-hosted Git service. It is similar to GitHub, Bitbucket or Gitlab. The initial development have been done on Gogs but we have forked it and named it Gitea. If you want to read more about the reasons why we have done that please read this blog post.

Run Gitea service

Download Gitea binary from download page first.

$ wget https://dl.gitea.io/gitea/1.1.0/gitea-1.1.0-linux-amd64 -O gitea
@taija
taija / uptime-robot-microsoft-teams
Created May 15, 2017 14:31
Webhook for integrating Uptime Robot with Microsoft Teams
{
"text": " *alertDetails* - ID: *monitorID*. URL: [*monitorURL*](*monitorURL*)",
"title": "*monitorFriendlyName* is *alertTypeFriendlyName*"
}