View sort3.asm
%include "asm_io.inc" | |
extern _printf | |
segment data align=4 class=data use32 | |
EnterOne db "Enter number 1: ", 0 | |
EnterTwo db "Enter number 2: ", 0 | |
EnterThree db "Enter number 3: ", 0 | |
FormattedAnswer db "%d %d %d", 0 |
View commands.sh
# Turn on Developer Mode | |
# Open Settings -> Update and Security -> For developers | |
# Don't reboot yet | |
# Run in powershell administrator: | |
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux | |
# accept reboot | |
## Install Ubuntu | |
# run in powershell administrator: |
View MyCourses-RemoveAnnoyances.js
// ==UserScript== | |
// @name MyCourses-NoAnnoyance | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Remove most annoyances from My Courses | |
// @author Thatchapon | |
// @match https://mycourses.ict.mahidol.ac.th/* | |
// @require http://code.jquery.com/jquery-3.3.1.min.js | |
// @grant none | |
// ==/UserScript== |
View MyCourses-BulkDownload.js
// ==UserScript== | |
// @name MyCourses-BulkDownload | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://mycourses.ict.mahidol.ac.th/course/view.php?id=* | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.5/jszip.min.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jszip-utils/0.0.2/jszip-utils.min.js | |
// @require https://fastcdn.org/FileSaver.js/1.1.20151003/FileSaver.min.js |
View MyCourses-RemovePastEvents.js
$(function() { | |
if (top.location.hostname === "mycourses.ict.mahidol.ac.th") { | |
var _today = $(".today > .day")[0]; | |
if (typeof _today == 'undefined') | |
return; | |
var today = parseInt(_today.innerText); | |
var otherDays = $(".nottoday"); | |
$.each(otherDays, function() { | |
var otherDay = parseInt(this.firstChild.innerText); | |
if (otherDay < today) { |
View MyCourses-autoLogin.js
$(function() { | |
if (top.location.hostname === "mycourses.ict.mahidol.ac.th") { | |
var username = document.getElementById("username"); | |
var password = document.getElementById("password"); | |
if (username != null && password != null) { | |
username.value = "uxx88yyy"; | |
password.value = "password"; | |
document.forms["login"].submit(); | |
} | |
} |
View MyCourses-RecoloredCancelClassesEvents.js
$(function() { | |
if (top.location.hostname === "mycourses.ict.mahidol.ac.th") { | |
var events = $(".calendar_event_group"); | |
var eventLinks = $(".calendar_event_group > a"); | |
$.each(events, function() { | |
var link = this.childNodes[0]; | |
if (typeof link.text != 'undefined' && link.text.startsWith("Cancel")) { | |
this.style.backgroundColor = this.style.borderColor = "#ffb3b3"; | |
var day = this.parentElement.parentElement.childNodes[0].childNodes[0].text; | |
$.each(eventLinks, function() { |
View ContainsEmoji.m
#import <UIKit/UIKit.h> | |
#import <CoreFoundation/CoreFoundation.h> | |
#import <CoreGraphics/CoreGraphics.h> | |
#import <CoreText/CoreText.h> | |
@interface EmojiUtilities : NSObject | |
+ (CFMutableCharacterSetRef)emojiCharacterSet; | |
+ (BOOL)containsEmoji:(NSString *)emoji; | |
@end |
View shell.c
#include <stdio.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <assert.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <sys/wait.h> | |
#define MAXH 2000 | |
#define MAXSHOW 100 |
View eLearning-activeCourses.js
$(function() { | |
if (top.location.hostname === 'elearning.ict.mahidol.ac.th') { | |
var activeCourses = [ "ITCS343", "ITCS381", "ITCS323", "ITCS335", "ITLG202", "ITCS241", "ITID274" ]; // for example | |
var courses = $(".block_course_list > .content > .list").children(); | |
$.each(courses, function() { | |
var title = $(this).text().split(" - ")[0]; | |
if ($.inArray(title, activeCourses) == -1) | |
$(this).hide(); | |
}); | |
} |
NewerOlder