Skip to content

Instantly share code, notes, and snippets.

View bangpound's full-sized avatar

Benjamin Doherty bangpound

View GitHub Profile
@rejsmont
rejsmont / AclFilter.php
Last active February 14, 2019 08:10
ACL filter for Doctrine QueryBuilder and Query. Supports multiple filters applied to a single query, entity inheritance and role hierarchies.
<?php
/*
* Copyright 2013 Radoslaw Kamil Ejsmont <radoslaw@ejsmont.net>
*
* Original code by mailaneel is available at
* https://gist.github.com/mailaneel/1363377
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@Sjeanpierre
Sjeanpierre / athena_ddl
Created December 6, 2018 06:26
Cloudflare logs Athena DDL - Create Athena schema for Cloudflare logs
CREATE EXTERNAL TABLE `cf_logs`(
`cachecachestatus` string COMMENT 'from deserializer',
`cacheresponsebytes` int COMMENT 'from deserializer',
`cacheresponsestatus` int COMMENT 'from deserializer',
`cachetieredfill` boolean COMMENT 'from deserializer',
`clientasn` int COMMENT 'from deserializer',
`clientcountry` string COMMENT 'from deserializer',
`clientdevicetype` string COMMENT 'from deserializer',
`clientip` string COMMENT 'from deserializer',
`clientipclass` string COMMENT 'from deserializer',
@haschek
haschek / _contrast.scss
Last active August 14, 2019 14:20
SCSS/SASS Accessibility Color Methods
/*
SCSS Color Methods for Accessibility
================================================================================
Adjust given colors to ensure that those color combination provide sufficient
contrast.
@version 0.1
@link http://eye48.com/go/scsscontrast
@rintaun
rintaun / closurize.php
Created May 23, 2012 03:50
closurize(): Converts any valid PHP callable into a Closure. Requires PHP 5.4.0+.
<?php
/**
* Converts any valid PHP callable into a Closure. Requires PHP 5.4.0+.
*
* The ramifications of this are many, but basically it means that any function
* or method can be converted into a Closure, bound to another scope, and
* executed easily. Works properly even with private methods.
*
* - On success, returns a Closure corresponding to the provided callable.
* - If the parameter is not callable, issues an E_USER_WARNING and returns a
@jeffdonthemic
jeffdonthemic / CustomAccountLookup.page
Last active January 12, 2021 15:17
Roll Your Own Salesforce "Lookup" Popup Window blog post
<apex:page controller="CustomAccountLookupController"
title="Search"
showHeader="false"
sideBar="false"
tabStyle="Account"
id="pg">
<apex:form >
<apex:outputPanel id="page" layout="block" style="margin:5px;padding:10px;padding-top:2px;">
<apex:tabPanel switchType="client" selectedTab="name1" id="tabbedPanel">
@wodka
wodka / ThreadPoolCommand.php
Last active February 18, 2021 20:26
Simple Symfony3 command Thread Pool
<?php
namespace AppBundle\Command;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\Process;
@MateoV
MateoV / enable-coredumps.sh
Created June 11, 2015 21:28
How to enable coredumps on an EC2
sudo su
echo "core.%e.%p.%h.%t" > /proc/sys/kernel/core_pattern
ulimit -c unlimited
@zmaril
zmaril / softwarehelpskill.md
Last active August 3, 2021 04:52
I want to write software that helps kill people.

I want to write software that helps kill people.

Please, before you call the police and get my github account put on lockdown, allow me a moment to explain. What I really want to do is work on projects that advance the human condition and improve people's lives. I've been in a mad dash to learn how to program for the past four or five years exactly because I realized how much good I could do for the world with a computer.

@dannguyen
dannguyen / congress-twitter-data-getter.md
Last active August 21, 2022 07:57
Who Congress Follows on Twitter data

Find out who Congress follows on Twitter using the command line

Part of a lesson for the Stanford Journalism Computational Methods in the Civic Sphere

This is a short tutorial on how to use command-line tools, including csvfix and t, the command-line Twitter interface, to access and parse data from the Sunlight Foundation and Twitter. The end goal of this exercise is to gather who everyone in Congress follows (friends, in the parlance of Twitter), and then count up the common friends to find out which Twitter accounts are most followed by members of Congress.

Here's a screenshot of the result, after it's been imported into [Google Spreadsheets](https://docs.google.com/spreadsheets/d/1cjRJyrPYj8KAhUrot8ubPOWgbAwm0OqIgPtsswJ2sjM/edit#gid=1358907576

@imathis
imathis / tweetbot-mute-regex.md
Created June 27, 2012 19:45
Tweetbot can use regular expressions to mute tweets in your timeline and mentions.

Hashtag abuse

Three or more hashtags.

#[^#]+#[^#]+#

Long hashtags (15+ characters): #hashtagpunchline