Skip to content

Instantly share code, notes, and snippets.

View yanglr's full-sized avatar
🎯
Focusing

Bravo Yeung yanglr

🎯
Focusing
View GitHub Profile
@trajano
trajano / settings.json
Last active June 21, 2024 11:27
Windows Terminal (with git bash and additional shortcuts)
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{00000000-0000-0000-ba54-000000000002}",
"launchMode": "maximized",
"theme": "light",
"useTabSwitcher": false,
"tabWidthMode": "titleLength",
"profiles": {
@yanglr
yanglr / get_youtube_channel_rss_feed.js
Last active January 16, 2021 07:42 — forked from arieljannai/get_youtube_channel_rss_feed.js
Script to get YouTube Channel RSS Feed (Add to Greasemonkey or Tampermonkey)
// ==UserScript==
// @name Get Youtebe RSS
// @namespace http://tampermonkey.net/
// @include https://*youtube.com/*
// @require http://code.jquery.com/jquery-3.3.1.min.js
// @version 0.1
// @description try to take over the world!
// @author Bravo Yeung
// @grant none
// ==/UserScript==
@troelskn
troelskn / gist:1287893
Created October 14, 2011 18:24
Luhn's algorithm in php
<?php
function is_valid_luhn($number) {
settype($number, 'string');
$sumTable = array(
array(0,1,2,3,4,5,6,7,8,9),
array(0,2,4,6,8,1,3,5,7,9));
$sum = 0;
$flip = 0;
for ($i = strlen($number) - 1; $i >= 0; $i--) {
$sum += $sumTable[$flip++ & 0x1][$number[$i]];