Skip to content

Instantly share code, notes, and snippets.

View WyriHaximus's full-sized avatar
🐉
Breathing Fire

Cees-Jan Kiewiet WyriHaximus

🐉
Breathing Fire
View GitHub Profile
<?php
function random_exception()
{
foreach(get_declared_classes() as $class) {
$exceptions = [];
if (substr($class, -9) === 'Exception') {
$exceptions[] = $class;
}
$exception = $exceptions[array_rand($exceptions)];
@ericclemmons
ericclemmons / example.md
Last active October 13, 2025 15:16
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@mitchellvanw
mitchellvanw / .zshrc
Last active May 7, 2016 22:42
Commit already...
ca () {
message=$(curl -s whatthecommit.com/index.txt)
git add .
git commit -a -m "$message";
}
@jeroenvdgulik
jeroenvdgulik / Talklist.md
Last active December 17, 2023 19:04
My mostly incomplete list of memorable talks that should probably be required material

The list is now hosted on a repository so you can PR -> https://github.com/jeroenvdgulik/awesome-talks/blob/master/README.md

The list

@rauchg
rauchg / README.md
Last active December 30, 2025 06:51
require-from-twitter
@jippi
jippi / Makefile
Last active October 12, 2017 07:52
CakePHP inside a Phar file. NOTE: Change "ROOT" constant in paths.php to "."
SHELL := /bin/bash
.PHONY: phar clean help
.DEFAULT_GOAL := help
phar: ## Build a phar file
mkdir -p dist/
rm -f dist/bownty-infra.phar
php build.php
chmod 0775 dist/bownty-infra.phar
@ThijsFeryn
ThijsFeryn / composer.json
Created November 12, 2015 14:14
Simple ESI rendering example using Silex and Varnish v4. The render_esi function in Twig renders ESI tags when the right Surrogate-Capability header is thrown, otherwise it uses internal subrequests.
{
"require": {
"silex/silex": "1.3.*",
"symfony/twig-bridge": "2.7",
"twig/twig": "1.23.*"
}
}
@boekkooi
boekkooi / Collection.php
Created September 14, 2015 08:30
ValueObject + Broadway
<?php
namespace Xoip\Component\ValueObject;
interface Collection extends \IteratorAggregate, \Countable
{
/**
* Adds an element at the end of the collection.
*
* @param ValueObject $object The object to add.
*
@jamescmartinez
jamescmartinez / slack_delete.rb
Last active March 14, 2025 19:45
This Ruby script will bulk remove all Slack files older than 30 days. Just add your API token from https://api.slack.com/web#authentication into the token quotes at the top of the file.
require 'net/http'
require 'json'
require 'uri'
@token = ''
def list_files
ts_to = (Time.now - 30 * 24 * 60 * 60).to_i # 30 days ago
params = {
token: @token,
@dragonfax
dragonfax / autoclick.js
Last active December 17, 2019 23:28
auto clicker for steam summer game (wchill version)
// ==UserScript==
// @name Monster Minigame Auto-script
// @namespace https://github.com/wchill/steamSummerMinigame
// @description A script that runs the Steam Monster Minigame for you. Modified from mouseas's original version to include autoclick.
// @version 1.0
// @match http://steamcommunity.com/minigame/towerattack*
// @updateURL https://raw.githubusercontent.com/wchill/steamSummerMinigame/master/autoPlay.js
// @downloadURL https://raw.githubusercontent.com/wchill/steamSummerMinigame/master/autoPlay.js
// ==/UserScript==