Skip to content

Instantly share code, notes, and snippets.

View youngershen's full-sized avatar
🎯
Focusing

Younger Shen youngershen

🎯
Focusing
View GitHub Profile
@youngershen
youngershen / gist:b5c543cb6e9bfe95fc252b8856e93a85
Created October 11, 2021 14:43
GodBlock-Interview-Questions
Q1
Convert a non-negative integer num to its English words representation.
Example 1:
Input: num = 123
Output: "One Hundred Twenty Three"
Example 2:
@youngershen
youngershen / Q1
Last active September 25, 2021 14:47
Blockchain Interview quiz 101
Q1
Convert a non-negative integer num to its English words representation.
Example 1:
Input: num = 123
Output: "One Hundred Twenty Three"
Example 2:
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.iconv = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";
var Buffer = require("buffer").Buffer;
// Multibyte codec. In this scheme, a character is represented by 1 or more bytes.
// Our codec supports UTF-16 surrogates,
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.iconv = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";
var Buffer = require("buffer").Buffer;
// Multibyte codec. In this scheme, a character is represented by 1 or more bytes.
// Our codec supports UTF-16 surrogates,
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
"use strict";
var Buffer = require("buffer").Buffer;
// Multibyte codec. In this scheme, a character is represented by 1 or more bytes.
// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences.
// To save memory and loading time, we read table files only when requested.
exports._dbcs = DBCSCodec;
@youngershen
youngershen / gist:29cf8562d73f03cd7636
Created March 25, 2015 02:11
下载songtaste歌曲的脚本
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import urllib2
from bs4 import BeautifulSoup
import requests
BASEURL = 'http://www.songtaste.com/time.php'
def get_song_url(url):
html = urllib2.urlopen(url).read()
@youngershen
youngershen / gist:3705289
Created September 12, 2012 08:39
一个songtaste下载帮助油猴脚本
// ==UserScript==
// @name SongTasteHelper
// @namespace com.youngershen.songtaste
// @description 安装该插件之后会自动在songtaste的音乐播放页面显示获取歌曲链接的按钮,然后点击之,再然后,你懂的....
// @include http://www.songtaste.com/song/*
// @version 1
// ==/UserScript==
var button_str = "<button onclick = 'window.getSongURL()'>获取链接</button>";
document.body.innerHTML = button_str + document.body.innerHTML;
@youngershen
youngershen / LolMatchLeader.lua
Created August 28, 2012 06:49
lol match leader
-- project : LolMatchLeader
-- author : younger.shen
-- filename : LolMatchLeader.lua
-- filepath : /C/Users/Administrator/Desktop/LolMatchLeader.lua
[[
该程序用来确定某一个lol队伍的leader.
请求格式:
/?gameid=xxx&server=xxx&teamid=xxx&player=xxx
返回格式:
@youngershen
youngershen / qvodFetch.py
Created April 24, 2012 11:35
fetch the qvod link in the qvodzy.me site
from bs4 import BeautifulSoup
import urllib
import os
import re
qvod_link_reg = re.compile(ur'qvod://[0-9]{9}\|[A-Z0-9]{40}\|[\u4e00-\u9fa50-9]+\.')
main_url = 'http://www.qvodzy.me'
def matchURL(url):
res = urllib.urlopen(url)
@youngershen
youngershen / gist:2421224
Created April 19, 2012 14:15
你妹的,晚上就敲了这几行,pygame还老假死,去你妹
import os
import pygame
from pygame.locals import *
import pygame.surfarray as surfarray
def init():
pygame.init()
screen = pygame.display.set_mode((500,500))