Skip to content

Instantly share code, notes, and snippets.

View xuchunyang's full-sized avatar

Xu Chunyang xuchunyang

View GitHub Profile
@karlhillx
karlhillx / laravel-mix-font-awesome.md
Last active December 21, 2022 15:35
Want to use Laravel and Font Awesome? (Regularly updated)

Laravel Mix & Font Awesome Setup: Compiling Assets

This document provides help on getting your Laravel instance running with the latest versions of Laravel Mix and Font Awesome. Note: This guide is for Laravel versions 5 through 7. If you are using Laravel 8, please go here.

Laravel Mix
@fnky
fnky / ANSI.md
Last active May 11, 2024 10:53
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@mfurlend
mfurlend / webtorrent-desktop-batch-delete.js
Created October 4, 2018 16:19
webtorrent-desktop batch delete scripts
//Delete all
let delete_buttons = Array.from(document.getElementsByClassName('delete'))
while (delete_buttons.length > 0) {
let button = delete_buttons.pop();
button.click();
Array.from(document.querySelector('.control.ok').getElementsByTagName('*')).forEach(o=>o.click());
}
// Delete paused
@BenSampo
BenSampo / deploy.sh
Last active April 30, 2024 03:41
Laravel deploy script
# Change to the project directory
cd $FORGE_SITE_PATH
# Turn on maintenance mode
php artisan down || true
# Pull the latest changes from the git repository
# git reset --hard
# git clean -df
git pull origin $FORGE_SITE_BRANCH
@Lemmings19
Lemmings19 / LaravelRecursiveBlade.php
Last active October 15, 2022 09:59
How to create a recursive list in a Blade. (Laravel)
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class TestController extends Controller
{
/**
* This is just a quick example of how to create a recursive list of items
@reborg
reborg / rich-already-answered-that.md
Last active May 8, 2024 14:20
A curated collection of answers that Rich gave throughout the history of Clojure

Rich Already Answered That!

A list of commonly asked questions, design decisions, reasons why Clojure is the way it is as they were answered directly by Rich (even when from many years ago, those answers are pretty much valid today!). Feel free to point friends and colleagues here next time they ask (again). Answers are pasted verbatim (I've made small adjustments for readibility, but never changed a sentence) from mailing lists, articles, chats.

How to use:

  • The link in the table of content jumps at the copy of the answer on this page.
  • The link on the answer itself points back at the original post.

Table of Content

@luochen1990
luochen1990 / bad-whitespace-example.txt
Last active September 25, 2023 07:52
团队协作的场景下, 需要对团队成员的git使用方式有一定的要求, 以保证协作的畅通和高效.
hello
tab indent
space indent
tab indent with following space
space before tab
space at eol (trailing-space)
tab at eol (trailing-space)
blank at eof (also trailing-space)
@HaleTom
HaleTom / print256colours.sh
Last active May 2, 2024 14:43
Print a 256-colour test pattern in the terminal
#!/bin/bash
# Tom Hale, 2016. MIT Licence.
# Print out 256 colours, with each number printed in its corresponding colour
# See http://askubuntu.com/questions/821157/print-a-256-color-test-pattern-in-the-terminal/821163#821163
set -eu # Fail on errors or undeclared variables
printable_colours=256

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@samyk
samyk / chrome_tabs.osa
Created June 14, 2016 18:36
applescript to show all url+titles of Chrome tabs along with front window+tab url+title
# shows all url+titles of Chrome along with front window+tab url+title
set titleString to ""
tell application "Google Chrome"
set window_list to every window # get the windows
repeat with the_window in window_list # for every window
set tab_list to every tab in the_window # get the tabs
repeat with the_tab in tab_list # for every tab