Skip to content

Instantly share code, notes, and snippets.

Avatar

Euan euantorano

View GitHub Profile
@andrewrk
andrewrk / example.zig
Last active Jan 1, 2020
how to create a small zig file for viewing IR
View example.zig
// trick #1 export a void function and put your logic here
// using std lib functions creates a lot of IR
export fn entry() void {
var x: i32 = 1;
x += 1;
}
// trick #2, override the default panic handler to something trivial
const std = @import("std");
pub fn panic(msg: []const u8, error_return_trace: ?*std.builtin.StackTrace) noreturn {
@euantorano
euantorano / php_tag_fixer
Created Jul 21, 2014
Removes closing PHP tags from files which currently have one withina directory.
View php_tag_fixer
#!/usr/bin/python
import os, sys, re, argparse
parser = argparse.ArgumentParser(description='Fix PHP file endings')
parser.add_argument('directory', metavar='d', help='The path to the PHP sources')
args = parser.parse_args()
path = args.directory
@kyledrake
kyledrake / ferengi-plan.txt
Last active Jul 9, 2020
How to throttle the FCC to dial up modem speeds on your website using Nginx
View ferengi-plan.txt
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@philsturgeon
philsturgeon / 0-intro.md
Last active Jun 7, 2018
PSR-2 v CodeSniffer PSR-2
View 0-intro.md

This is a list of issues or discrepencies between the wording or intention of PSR-2 itself and the CodeSniffer PSR-2 ruleset.

Add suggestions in the comments or tweet me (@philsturgeon) if you have more inconsistencies to report.

View regex-weburl.js
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Created: 2010/12/05
// Updated: 2018/09/12
// License: MIT
//
// Copyright (c) 2010-2018 Diego Perini (http://www.iport.it)
//
You can’t perform that action at this time.