Skip to content

Instantly share code, notes, and snippets.

View yanglr's full-sized avatar
🎯
Focusing

Bravo Yeung yanglr

🎯
Focusing
View GitHub Profile
@yanglr
yanglr / tweet_dumper.py
Created May 26, 2020 09:52 — forked from yanofsky/LICENSE
A script to download all of a user's tweets into a csv
#!/usr/bin/env python
# encoding: utf-8
import tweepy #https://github.com/tweepy/tweepy
import csv
#Twitter API credentials
consumer_key = ""
consumer_secret = ""
access_key = ""
@yanglr
yanglr / zhihu_hot.js
Created June 6, 2019 04:08 — forked from kaid/zhihu_hot.js
知乎热门问题抓取脚本
//==== Displayer ====
var Displayer = function() {
this.$el = jQuery("body").prepend(
"<div class=\"hotqs-list\">" +
"<div class=\"head\">" +
"<div>关注</div>" +
"<div>回答</div>" +
"</div>" +
"<div class=\"loading\">开始抓取问题</div>" +
@yanglr
yanglr / profile.json
Created May 14, 2019 09:13 — forked from shanselman/profile.json
Windows Terminal Profile
{
"defaultProfile": "{7d04ce37-c00f-43ac-ba47-992cb1393215}",
"initialRows": 30,
"initialCols": 120,
"alwaysShowTabs": true,
"showTerminalTitleInTitlebar": true,
"experimental_showTabsInTitlebar": true,
"requestedTheme": "dark",
"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==
@yanglr
yanglr / clipboard-example.html
Created March 31, 2019 06:50 — forked from scottoffen/clipboard-example.html
JavaScript Copy To Clipboard Example
<!doctype html>
<html lang=en>
<head>
<meta charset=utf-8>
<title>Copy To Clipboard Example</title>
</head>
<body>
<input id="txtToCopy" type="text">
<button id="btnCopy">Copy!</button>
@yanglr
yanglr / App.xaml
Created March 16, 2019 02:33 — forked from dbuksbaum/App.xaml
Bootstrapping Caliburn.Micro with Autofac
<Application x:Class="HelloAutofac.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:HelloAutofac">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary>
<local:MyBootStrapper x:Key="bootstrapper" />
</ResourceDictionary>
@yanglr
yanglr / ningx.sh
Created June 15, 2016 07:28 — forked from amaudy/ningx.sh
Nginx init script for Openresty on Ubuntu
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nginx init.d dash script for Ubuntu <=9.10.
# Description: nginx init.d dash script for Ubuntu <=9.10.
### END INIT INFO
@yanglr
yanglr / gist:ba68e1ae1f906771e96325f6a2e50783
Created May 6, 2016 13:19 — forked from troelskn/gist:1287893
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]];
<a class="question_link" target="_blank" href="/question/30746665/answer/49332475">会写 Parser、Tokenizer 是什么水平?</a><br/><br/>大多数编译原理书前100页的内容,说明大学听了一半左右的编译原理课,通俗地说,写了这个只能证明你不是个棒槌。<br><br><br>所以其实你更应该关心不会tokenizer和parser是什么水平。
<span class="answer-date-link-wrap">
<a class="answer-date-link last_updated meta-item" data-tip="s$t$发布于 2015-05-29" target="_blank" href="/question/30746665/answer/49332475">编辑于 2015-05-29</a>
</span>
<hr/><a class="question_link" target="_blank" href="/question/30703519/answer/49150834">王垠到底对 winter 做了什么?</a><br/><br/>你可以理解为是路边看到一坨**,忍不住想去一脚踩爆它的心态。(虽然我知道这么做无聊而且会沾一脚)<br><br>想了想,可能还有一点觉得他的粉丝很可怜的,想让他们停止吃**的心态吧,虽然我知道"然而没卵用"。<br><br>回到题主的问题,要问做了什么,那就是“他是**,还碰巧被我看到了”,这样的事情,简直无法被饶恕。
@yanglr
yanglr / jsmath.js
Created November 4, 2015 13:29 — forked from chris-taylor/jsmath.js
jsMath inclusion
/**********************************************************************
*
* Customize the values given below to suit your needs.
* You can make additional copies of this file with
* different customizated settings if you need to load
* jsMath with different parameters.
*
* Load this page via:
*
* <SCRIPT SRC="path-to-jsMath/easy/load.js"></SCRIPT>