This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Fact] | |
public void SmallestSignedAngleBetweenShouldWork () | |
{ | |
WMath.SmallestSignedAngleBetween(0.1, 0.2).Should().BeApproximately(0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.1, 0.2+Math.PI*2).Should().BeApproximately(0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.1, 0.2-Math.PI*2).Should().BeApproximately(0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.1+Math.PI*2, 0.2).Should().BeApproximately(0.1, 1e-5); | |
WMath.SmallestSignedAngleBetween(0.1-Math.PI*2, 0.2).Should().BeApproximately(0.1, 1e-5); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter('gettext',fn($t)=> | |
@$t[4]&&@$GLOBALS['wp_locale'] | |
?["Such $t","Very $t",'Wow'][rand(0,2)] | |
:$t); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INITIALISATION | |
============== | |
load wp-config.php | |
set up default constants | |
load wp-content/advanced-cache.php if it exists | |
load wp-content/db.php if it exists | |
connect to mysql, select db | |
load object cache (object-cache.php if it exists, or wp-include/cache.php if not) | |
load wp-content/sunrise.php if it exists (multisite only) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Hello Taylor | |
Plugin URI: https://gist.github.com/lgladdy/9e1a7303c6a6bf43b9b1 | |
Description: This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in <strike>two</strike> words sung most famously by <strike>Louis Armstrong: Hello, Dolly.</strike>Taylor Swift. When activated you will randomly see a lyric from <strike><cite>Hello, Dolly</cite></strike><cite>Taylor Swift</cite> in the upper right of your admin screen on every page. | |
Author: Liam Gladdy (based on Hello Dolly by Matt Mullenweg) | |
Version: 1.1 | |
Author URI: http://www.twitter.com/lgladdy & http://ma.tt/ | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<templateSet group="WordPress"> | |
<template name="aa" value="add_action( '$hook$', '$callback$' ); $END$" description="add_action" toReformat="false" toShortenFQNames="true"> | |
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" /> | |
<variable name="callback" expression="" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="HTML_TEXT" value="false" /> | |
<option name="HTML" value="false" /> | |
<option name="XSL_TEXT" value="false" /> | |
<option name="XML" value="false" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//oauth2 auth | |
chrome.identity.getAuthToken( | |
{'interactive': true}, | |
function(){ | |
//load Google's javascript client libraries | |
window.gapi_onload = authorize; | |
loadScript('https://apis.google.com/js/client.js'); | |
} | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# Make your Mac feel like home... | |
# Shoutout to @dtsn for being generally awesome and getting me started. | |
# | |
# install it: | |
# curl -sL https://gist.github.com/BenNunney/7219538/raw/f9b933cca93b67dd63a2d8b1eeebb69e87dc9591/feels-like-home.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2014 Code for the People Ltd | |
_____________ | |
/ ____ \ | |
_____/ \ \ \ | |
/\ \ \___\ \ | |
/ \ \ \ | |
/ / / _______\ | |
/ / / \ / | |
/ / / \ / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Takes a composer controlled repo and pushes a | |
# composed PACKAGE into a branch called "PACKAGE". | |
( | |
# SANITY CHECKS | |
# Check for uncommitted changes, and refuse to proceed if there are any | |
if [ -n "$(git ls-files . --exclude-standard --others)" ]; then |