Skip to content

Instantly share code, notes, and snippets.

View minitech's full-sized avatar

Ryan O’Hara minitech

  • British Columbia, Canada
View GitHub Profile
@minitech
minitech / blog.c
Last active December 19, 2015 17:39
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/epoll.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <fcntl.h>
@minitech
minitech / unsyntax.js
Created April 30, 2013 18:44
JavaSckript Moste Evile. Run with node --harmony-proxies, then just run.
with(evil()) {
get /user
(response) (
response.write("Hello, world!")
)
post /user
(response) (
response.write("Unauthorized!")
)
@jrgifford
jrgifford / gist:4684150
Created January 31, 2013 16:34
Open Source Web Application Security Alliance

###Problem: We have lots of open source applications out there, run by volunteers. Security issues have been popping up all over the place with the recent rails and rubygems.org exploits, and we'll be feeling the effects of this for years.

###Solution: We have a github org (or even just a mailing list) of vetted open source developers who have expressed interest in helping with security stuff.

In more details:

  • Github/mailing list with open source developers who have somehow been vetted by the community (no clue how to do this, maybe based off of how many people have signed their GPG key? something else?)

  • A open source application can apply to join - should have a 5:1 project:dev ratio at most.

@minitech
minitech / web-checklist.md
Last active January 4, 2020 11:59
minitech’s Web Checklist

minitech’s Web Checklist

Here are some guidelines that will make me actually like your amazing new web application!

  1. Make sure encoding is handled properly every step of the way. If comes out as ’, you’ve got a problem on your hands. 😊

  2. Make it accessible. Turn off images, JavaScript, and CSS. If your website is still legible and usable (it’s okay if it’s just barely usable, or not particularly interactive) then you are already in the top 0.01%.

  3. Check your grammar. One of the fastest ways to lose respect in a blog post (or worse — in body copy) is to make basic orthographical or grammatical mistakes. These include, but are not limited to:

  • Missing apostrophes — [Bitbucket even did that][bitbucket-apostrophe-catastrophe].
@minitech
minitech / gist:3980564
Created October 30, 2012 14:37
A shutdown with confirmation for Windows 8 pinning
If MsgBox("Are you sure you want to shut down?", vbExclamation Or vbYesNo Or vbDefaultButton2, "Shut down") = vbYes Then
Dim wsh : Set wsh = CreateObject("WScript.Shell")
wsh.Run "shutdown /s /t 0"
End If
@minitech
minitech / group-by.js
Created June 28, 2012 16:30
Grouping in JavaScript
// A grouping function for JavaScript.
// Created by Ryan O'Hara.
// Usage:
// group([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], function(x) { return x % 2; });
// group({a: 20, b: 30, c: 40, d: 50}, function(x) { return x % 20; });
// Result:
// [[1, 3, 5, 7, 9], [2, 4, 6, 8, 10]]
// [{a: 20, c: 40}, {b: 30, d: 50}]
function group(obj, func, thisArg) {
@minitech
minitech / forget-you.js
Created December 10, 2011 01:53
Disables some "Remember Me" checkboxes on Firefox. GreaseMonkey user script.
// ==UserScript==
// @name Forget You
// @namespace about:blank
// @description Makes sure that users are never remembered, this being a public computer.
// ==/UserScript==
// Created by Ryan O'Hara (minitech), a customer.
// Enjoy my first Greasemonkey script!
// http://git.io/ry