Skip to content

Instantly share code, notes, and snippets.

View serverwentdown's full-sized avatar

Ambrose Chua serverwentdown

View GitHub Profile
@serverwentdown
serverwentdown / LAB_Makefile
Created August 31, 2014 08:14
Makefile for all my CS C labs
all:
for f in `find * -type d -maxdepth 0 ! -regex .`; do\
gcc -o $$f/main.o $$f/main.c;\
done;
@serverwentdown
serverwentdown / randomindex.html
Created August 23, 2014 16:19
Random jekyll post
---
title: random
---
<script>
var posts = [{% for post in site.posts %}"{{ post.url }}", {% endfor %}];
var id = Math.floor(Math.random() * posts.length);
window.location.href = posts[id];
</script>
@serverwentdown
serverwentdown / nushemails.md
Last active June 6, 2016 08:59
Setting up NUS High emails on iOS/OSX and Android, and most other email applications. Pass this to those who need it? IDK

Get your inbox synced down to your phone!

TL; DR: IMAP outlook.office365.com:993 SSL/TLS; SMTP smtp.office365.com:587 STARTTLS.


iOS/OSX

Settings > Mail, Contacts, Calendar > Add Account

#!/bin/bash
#
# Very simple ping request spammer
#
# Usage:
# sudo ./pingspam.sh ipv6address datasize threads &
#
# eg: sudo ./pingspam.sh ::1 4096 40 &
#
<!--
Feel free to edit this document!
-->
<!DOCTYPE html>
<html lang="en">
<head>
@serverwentdown
serverwentdown / typethis.js
Created May 8, 2014 12:47
Typing thingy...
process.stdin.setEncoding('utf8');
var str = "File I/O is provided by simple wrappers around standard POSIX functions. To use this module do require('fs'). All the methods have asynchronous and synchronous forms.";
console.log("Hello! ");
console.log("Type this out and press return: ");
console.log("--------------------------");
console.log(str);
console.log("--------------------------");
process.stdout.write("Press enter to start: ");
@serverwentdown
serverwentdown / github-latest-package.js
Created March 10, 2014 15:09
Random snippet to get latest links for GitHub releases.
var username = "github"; // Put username here
var repo = "ruby"; // Put repository name here
/*
That's it! Now use this URL format:
http://github.com/<username>/<repo>/releases#MyAwesomePackagedApp.zip
Where <username> and <repo> are exactly as defined in those variables, and MyAwesomePackagedApp.zip is whatever filename of the ZIP you uploaded in the "releases" page of your repository.
**DOES not work with source code downloads**
@serverwentdown
serverwentdown / static_server.js
Last active December 26, 2015 14:43 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument. (Modded for larger files)
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 4002;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
@serverwentdown
serverwentdown / Summer.css
Last active April 6, 2022 23:46
(MIT Licensed) Lato is "Summer" in Polish. Live: http://codepen.io/ambc/pen/waBqE A simple theme in CSS. Created initially for [Mou](http://mouapp.com/). Feel free to fork. Requires [Lato](http://google.com/fonts/specimen/Lato) and Monaco fonts installed. Should go well on print.
@import url(//fonts.googleapis.com/css?family=Lato:400,700,900,400italic,700italic,900italic);
/* Reset.css */ html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
/* Stuff under public domain: */
*, *:before, *:after {
box-sizing: border-box;
}
*:focus {
@serverwentdown
serverwentdown / fortune.sh
Last active January 1, 2016 17:49
Read the file please...
#!/bin/sh
# fortune.sh 10 print <- prints 10 fortunes on paper.
# fortune.sh 12 <- prints 12 fortunes to cat.
printf "" > tmp.txt
for i in $(eval echo {0..$1 })
do
printf "\n" >> tmp.txt
fortune >> tmp.txt