Skip to content

Instantly share code, notes, and snippets.

Sitan Huang(黄斯坦) SitanHuang

Block or report user

Report or block SitanHuang

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View typeracer.hack.js
function triggerKeyboardEvent(el, keyCode, type)
{
var eventObj = document.createEventObject ?
document.createEventObject() : document.createEvent("Events");
if(eventObj.initEvent){
eventObj.initEvent(type, true, true);
}
eventObj.keyCode = keyCode;
@SitanHuang
SitanHuang / .rb
Created Jun 9, 2018
Ruby Pagination Algorithm HTML Generator
View .rb
module PaginationHelper
def paginate(current, max, template, delta: 2)
left = current - delta
right = current + delta + 1
range = []
range_with_dots = []
l = nil
max.times do |_i|
i = _i + 1
if i == 1 || i == max || i >= left && i < right
@SitanHuang
SitanHuang / STH.rb
Last active Apr 12, 2017
little encryption algorithm to encrypt anything, check bottom to see usage
View STH.rb
# ===================================================
# EXAMPLE IS ON BOTTOM
# EXAMPLE IS ON BOTTOM
# EXAMPLE IS ON BOTTOM
# EXAMPLE IS ON BOTTOM
# EXAMPLE IS ON BOTTOM
# ===================================================
require 'base64'
You can’t perform that action at this time.