This file contains hidden or 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 Scrapes IVLE Course ID | |
| // @namespace yijiang | |
| // @version 1 | |
| // @match https://ivle.nus.edu.sg/v1/lms/list_course.aspx?src=bm&code=&title=&lecName=&acadyear=2016%2f2017&semester=Semester+1&ModTitleExact=N&LecNameExact=N | |
| // @grant none | |
| // ==/UserScript== | |
| function switchPage(page){ | |
| $('#GV_Page2').val(page).change(); |
This file contains hidden or 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
| from pprint import pprint | |
| def find_majority(lst): | |
| maj = majority(lst) | |
| pprint(maj) | |
| if len(maj) > 1: | |
| return 'Not Found' | |
| else: | |
| return list(maj.keys())[0] |
This file contains hidden or 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 hidden or 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 CORS Tutorial Reordering | |
| // @namespace yijiang | |
| // @description Reorder CORS tutorial ranking using drag and drop | |
| // @include https://myaces.nus.edu.sg/cors/RankTutorialServlet | |
| // @require https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js | |
| // @require https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js | |
| // @version 1 | |
| // @grant none | |
| // ==/UserScript== |
This file contains hidden or 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
| @namespace url(http://www.w3.org/1999/xhtml); | |
| @-moz-document | |
| domain("gaming.stackexchange.com"), | |
| domain("meta.gaming.stackexchange.com") { | |
| /* Tag hover fix */ | |
| a.post-tag::before, span.post-tag::before { | |
| transition: all .15s; | |
| } |
This file contains hidden or 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\Http\Middleware; | |
| use Illuminate\Http\Request; | |
| class DenyFrames | |
| { | |
| public function handle(Request $request, \Closure $next) | |
| { | |
| return $next($request)->header('X-Frame-Options', 'DENY'); |
This file contains hidden or 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 hidden or 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 Illuminate\Console\Command; | |
| use App\User; | |
| class AddUser extends Command | |
| { | |
| /** |
This file contains hidden or 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
This file contains hidden or 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
| with open('1.in') as f: | |
| data = f.read() | |
| print('First half') | |
| print(data.count('(') - data.count(')')) | |
| i = 0 | |
| floor = 0 | |
| while floor >= 0: |