Skip to content

Instantly share code, notes, and snippets.

View yehchge's full-sized avatar
:octocat:
Working from office

yehchge yehchge

:octocat:
Working from office
View GitHub Profile
@yehchge
yehchge / .bash_prompt
Created July 22, 2022 02:44 — forked from diegodurs/.bash_prompt
Bash Prompt
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
# Shamelessly copied from https://github.com/gf3/dotfiles
# Screenshot: http://i.imgur.com/s0Blh.png
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi
@yehchge
yehchge / .bashrc
Created July 22, 2022 02:37 — forked from duese/.bashrc
Colored prompt with git-prompt enabled
# to get a git prompt:
source /usr/share/git/completion/git-prompt.sh
GIT_PS1_SHOWDIRTYSTATE=true
#GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
GIT_PS1_SHOWCOLORHINTS=true
# colorize bash prompt
# see also http://misc.flogisoft.com/bash/tip_colors_and_formatting
#PS1='[\u@\h \W]\$ ' # To leave the default one
@yehchge
yehchge / .prompt
Created July 22, 2022 02:32 — forked from heyitsolivia/.prompt
.prompt
# git prompt
# from http://gist.github.com/47364
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "⚡"
}
function git_prompt {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1='\[\e[1;33m\]\W\[\e[1;36m\]$(git_prompt)\[\e[1;33m\]$\[\e[m\] '
@yehchge
yehchge / php-8.1-strftime.php
Created January 18, 2022 05:51 — forked from bohwaz/php-8.1-strftime.php
strftime() replacement function for PHP 8.1
<?php
namespace PHP81_BC;
/**
* Locale-formatted strftime using IntlDateFormatter (PHP 8.1 compatible)
* This provides a cross-platform alternative to strftime() for when it will be removed from PHP.
* Note that output can be slightly different between libc sprintf and this function as it is using ICU.
*
* Usage:
* use func \PHP81_BC\strftime;
@yehchge
yehchge / stars.html
Created January 14, 2020 08:33 — forked from ziminds/stars.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Star Rating System</title>
<meta name="viewport" content="width=device-width">
<style>
.star{
color: goldenrod;
font-size: 2.0rem;

Web Development with Laravel 5

目標

如何在開發的過程中加入測試。

  1. Model
  2. Repository
  3. Controller
  4. Auth
@yehchge
yehchge / ansi-color.php
Created April 22, 2019 04:25 — forked from superbrothers/ansi-color.php
ANSI color terminal output module for php
<?php
/**
* php-ansi-color
*
* Original
* https://github.com/loopj/commonjs-ansi-color
*
* @code
* <?php
* require_once "ansi-color.php";
@yehchge
yehchge / update-git.sh
Created October 8, 2018 04:06 — forked from YuMS/update-git.sh
Update git to latest version on Ubuntu
#!/bin/bash
sudo add-apt-repository -y ppa:git-core/ppa
sudo apt-get update
sudo apt-get install git -y
@yehchge
yehchge / TaiwanStreetName
Created May 17, 2017 07:20 — forked from davidou123/TaiwanStreetName
這是一份台灣街道的資料 內容格式為[排序序號][郵遞區號三碼][縣市][鄉鎮市][路名] 資料來源來自於綠奶茶blog整理(http://milkmidi.blogspot.tw/2012/03/blog-post.html) ------------------------------------------------- 而他的資料來源是從中華郵政api撈出來的 http://www.post.gov.tw/post/internet/f_searchzone/streetNameData.jsp (直接點是無效的, 請用任意程式用 POST傳值) city:臺北市 cityarea:信義區 就會得到該區的街道XML
This file has been truncated, but you can view the full file.
-- phpMyAdmin SQL Dump
-- version 2.10.3
-- http://www.phpmyadmin.net
--
-- 主機: localhost
-- 建立日期: Mar 12, 2013, 03:16 PM
-- 伺服器版本: 5.0.51
-- PHP 版本: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
@yehchge
yehchge / example.js
Last active August 29, 2015 14:07 — forked from lukemorton/example.js
// In this example we detect if a user clicks a link to travel elsewhere
// but has made changes to a form. If they have changed the form it prompts
// them to confirm before continuing.
jQuery(function ($) {
var $form = $('form').watchChanges();
$('a').click(function (e) {
if ($form.hasChanged() and ! confirm('Continue without saving changes?')) {
e.preventDefault();
}