Skip to content

Instantly share code, notes, and snippets.

@mikeal
mikeal / gist:7724521
Last active December 29, 2015 20:29
Inclusive by Exclusion

When you build a community you're creating a culture. That culture will be about more than the code, the modules, or the language. The people you draw in will have their own biases and behaviors that impact the kinds of people you continue to draw as you grow.

Cultures will naturally fight behavior that is divisive. That is, behavior that is divisive to the established members of that community. As a community grows larger it is harder and harder to change what the culture finds acceptable because changing it, even if it is inclusive in nature, is disturbing and divisive to existing membership. Fighting for change in established cultures means dealing with a lot of dismissive language and attacks for the "tone" of your argument.

That is why it is so important that a culture becomes comfortable with aggressively fighting exclusionary behavior. While it is certainly more beneficial to make pro-active steps to increase diversity we cannot be dismissive of the effect that passionate reactions to poor behavior

@robotlolita
robotlolita / loops-are-evil.md
Last active March 2, 2022 17:19
Why `xs.each(f)` should not be considered a "loop".

First and foremost, let's take a look at the following pieces of code. The first one is something you should be rather familiar with, and the second one is also a somewhat familiar idiom these days (at least in languages with higher-order functions):

// Example 1:
30 + 12

// Example 2:
xs.map(f)

(stolen from the feminism thread on SA)

Feminism 101, or "What in the fuck is The Gilded Cage?"

If you are new to feminism, approaching it from a position of privilege, or haven't read any of these books for any reason, I strongly recommend them.

Feminism is For Everybody: Passionate Politics by bell hooks. Coming from the perspective of a woman of color, bell hooks calls for feminism free of divisive policies and rich with discussion. She critically analyzes the problems facing feminists today, and proposes a vision of a beloved community that appeals to all those committed to equality in just 125 pages and using simple, accessible language.

No Turning Back: The History of Feminism and the Future of Women by Estelle Freedman. The author, a Stanford professor, examines 200 years of feminism and describes the critical momentum which the movement has gained. She explores the new approaches women are taking to traditional feminist concerns, and insightfully debunks the claim the feminism is dea

@brandonkelly
brandonkelly / relatedTo.twig
Last active December 27, 2015 00:49
New 'relatedTo' element param coming in Craft 1.3
<h3>My favorite cocktails that have gin</h3>
{% set cocktails = craft.entries.section('cocktails').relatedTo('and', {
sourceElement: currentUser,
field: 'favoriteCocktails'
}, {
targetElement: craft.entries.section('ingredients').slug('gin'),
field: 'ingredients'
}) %}
@TheHiddenHaku
TheHiddenHaku / jwd.sql
Created October 30, 2013 09:51
MYSQL - Jaro-Winkler-Distance function
DELIMITER $$
CREATE DEFINER=`root`@`localhost` FUNCTION `jaro_winkler_similarity`(
in1 varchar(255),
in2 varchar(255)
) RETURNS float
DETERMINISTIC
BEGIN
#finestra:= search window, curString:= scanning cursor for the original string, curSub:= scanning cursor for the compared string
declare finestra, curString, curSub, maxSub, trasposizioni, prefixlen, maxPrefix int;
@brandonkelly
brandonkelly / gist:6532664
Created September 12, 2013 03:07
How to protect some text from getting auto-escaped by Twig, without using the raw filter
$charset = craft()->templates->getTwig()->getCharset();
$value = new \Twig_Markup($value, $charset);
@brandonkelly
brandonkelly / gist:6234999
Last active December 21, 2015 02:28
Turn a list of entries into JSON in Craft
{
entries: [
{% for entry in craft.entries.find() %}
{
title: "{{ entry.title | e('js') }}",
tags: [
{% for tag in entry.myTagsField %}
"{{ tag.name | e('js') }}" {% if not loop.last %},{% endif %}
@rmbl
rmbl / backtrace.php
Created June 14, 2013 10:53
Backtrace on fatal_error in PHP
<?php
function shutdown() {
$error = error_get_last();
if ($error['type'] === E_ERROR) {
// fatal error has occured
$trace = array_reverse($GLOBALS['dbg_stack']);
array_pop($trace);
if(php_sapi_name() == 'cli') {
echo 'Backtrace for: \'' . $error['message'] . '\' at ' . $error['file'] . ':' . $error['line'] . ':' . "\n";
foreach($trace as $item)
@litzinger
litzinger / 0-Debugging-ExpressionEngine.md
Last active January 26, 2023 20:28
How to show errors when you get a white screen in EE. Turning up the debugging will reveal PHP errors.

Overview

Below are two techniques to help debug the WSOD (white screen of death), usually a 500 server error, in an ExpressionEngine site. The Basic-Debugging option will be suitable in most cases and is specific to ExpressionEngine. The Advanced-Debugging is generic and applicable to any PHP based software. If the basic debugging does not work, try the advanced.

If you get a WSOD you will need to first get your site to reveal an error before reporting it to EllisLab or the add-on developer. Simply reporting "I get a white screen" does not give the developer enough information to assist you. An error message on the other hand will point the developer to the source of the issue.

@juliepagano
juliepagano / 101_off_limits.md
Last active December 16, 2020 09:37
101 conversations I generally don't want to have...

This list now exists over at http://juliepagano.com/blog/2013/11/02/101-off-limits/ and will be updated there.

I keep saying that impromptu, unwanted feminism 101 discussions are exhausting and not a good use of my resources. Then people ask what I mean by 101, so I'm starting to make a list. This list will change over time - I recommend checking back.

I highly recommend checking this list before engaging with me about feminism if you're new to it. It'll save both of us a lot of time and frustration.

Diversity in tech

Women aren't equally represented in tech because biology

Nope. This argument is bad and the science does not support it. Unfortunately, every time you say this out loud, you are contributing to cultural problems that do decrease the number of women in tech.