Skip to content

Instantly share code, notes, and snippets.

View allenyllee's full-sized avatar

Allen.YL allenyllee

View GitHub Profile
# GDC Vault videos can't be watched on mobile devices and this is a very sad thing indeed!
# (Note: this has changed for GDC2013, which lets you watch raw MP4 streams. Kudos!)
# This script is designed to circumvent this by downloading the lecture and slideshow
# videos which can then be re-encoded into whatever format you wish. Obviously, you
# won't be able to do this without access to the Vault. This is strictly for the
# convenience of legitimate Vault users!
# Note: this code is rather flimsy and was written as fast as possible for my own personal use.
# The code only works for the most recent GDC Vault videos, since they all use the same player
# format. If the XML format used to run the player is changed (as it has in the past), the code
@allenyllee
allenyllee / Probability.c
Last active July 13, 2016 02:54
There are some simple C function
/**
問題:假設記憶遊戲使用12張牌,6對(112233445566)
    規則為每次翻兩張,相同就保留,不同就蓋回背面
    給六次機會,請問用程式算翻出6對~1對的機率為何?
**/
/**
不記牌的抽中機率
@allenyllee
allenyllee / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@allenyllee
allenyllee / _Useful_Shell_Script.md
Last active July 13, 2016 02:46
There are some useful Shell Script.

#There are some useful Shell Script.

Linux Driver Coding Notes

##I/O Device Driver

  • Character Driver
  • Block Driver
@allenyllee
allenyllee / Sign.bat
Last active July 13, 2016 02:04
#There are some useful batch files.
@ECHO OFF
:sku_selection
Set PROJECT=
ECHO Which PROJECT do you want to sign?
ECHO 1. D17
ECHO 2. D15
ECHO 3. E15
Set /p PROJECT=Please type the number:
@allenyllee
allenyllee / SB_ACPIDelay.c
Last active July 13, 2016 02:45
There are some UEFI BIOS code snippet
#include <PegaCommonHeaders.h>
#define ACPI_TIMER_ADDRESS (PM_BASE_ADDR+0x08)
#define BITS_IN_ACPI_TIMER 24 // The current bits in ACPI Timer - Porting need
VOID SB_ACPIDelay(UINTN MicroSeconds)
{
UINTN TicksNeeded;
UINT32 TimerValue, NewTimerValue;
UINTN OverFlow;
// import_json_appsscript.js
// https://gist.github.com/allenyllee/c764c86ed722417948fc256b7a5077c4
//
// Changelog:
// (Oct. 16 2019) tag: allenyllee-20191016
// 1. Fixed google script error: urlfetchapp - service invoked too many times https://stackoverflow.com/questions/10598179/google-apps-script-urlfetchapp-service-invoked-too-many-times
// (Jul. 16 2018) tag: allenyllee-20180716
// 1. Fixed the issue "If you try to query /arrayA[k]/arrayB[n]/arrayC[m]/.../member, you will always get /arrayA[k]/arrayB[k]/arrayC[k]/.../member."
// (Nov. 30 2017) tag: allenyllee-20171130
// 1. Add the ability to query array elements by using xpath like "/array[n]/member" where "n" is array index
@allenyllee
allenyllee / public.py
Created August 24, 2017 14:09 — forked from dooglus/public.py
create Bitcoin public key from private key
#! /usr/bin/env python
class Point(object):
def __init__(self, _x, _y, _order = None): self.x, self.y, self.order = _x, _y, _order
def calc(self, top, bottom, other_x):
l = (top * inverse_mod(bottom)) % p
x3 = (l * l - self.x - other_x) % p
return Point(x3, (l * (self.x - x3) - self.y) % p)