Skip to content

Instantly share code, notes, and snippets.

@BPScott
BPScott / readme.md
Last active February 7, 2024 16:16
Github suggestion: Per-organization email overrides

This totally happened, y'all can stop +1ing this now. GitHub Blog post. Direct link to settings where you can set this.


#Per-organization / per-repo email overrides - A feature suggestion

Here the concepts "organization" and "user" are interchangeable, I'm talking about an entity that owns a repo, whether it is jQuery or John Resig. I'll stick to using organization as it best represents my original use-case.

##TL;DR

@BPScott
BPScott / readme.md
Created December 9, 2011 15:19
PHP on Heroku (please don't do this)

So Heroku's Cedar stack supports PHP but they're not exactly proud of it as it's not really mentioned anywhere apart from the Heroku & Facebook apps page

Try it out:

mkdir heroku-php
cd heroku-php
git init
heroku create --stack cedar

echo " index.php

@BPScott
BPScott / convert.rb
Created February 7, 2012 23:27
Fuckingawesomesongs.com songs object => one file per song
#Place in the root of your fuckingawesomesongs.com folder
#I convert the current contents of songs.rb into a one file per song structure
require 'YAML'
require_relative 'lib/songs'
def slugify string
string.downcase.gsub(/&/, 'and').gsub(/\s+/, '-').gsub(/[^a-z0-9-]/, '')
end
Songs.all.each do |song|
<script>
(function() {
var searches = document.location.search.substr(1).split('&');
var searchesLength = searches.length;
var item, elements, elementsLength, ele, normalisedTagName;
while (searchesLength--) {
item = searches[searchesLength].split('=');
@BPScott
BPScott / svn2git.sh
Last active December 15, 2015 18:19
SVN to git migration script for when SVN author names are X.509 subjects * Converts svn -> git * Migrates tags and branches to proper git styling * Converts commit author names to proper name/email pairs
#!/bin/sh
# Runs an SVN to GIT migration and changes SVN commit authors which are X.509
# subjects to proper authors.
#
# Usage
# ./svn2git.sh SVN_REPO_URL NEW_GIT_FOLDER_NAME
REPO=$1
REPO_NAME=$2
@BPScott
BPScott / QR-Code-Example
Created April 18, 2013 13:48
QR Code generation and instant preview from the command line
# Generating throwaway QR codes from the command line for shunting URLS to mobile devices
brew install qrencode
qrencode -o - http://www.google.com | open -f -a preview
@BPScott
BPScott / _list-utilities.scss
Created April 30, 2013 11:09
Sass list utilities
/**
* Search a list ($haystack) for a list of values ($needles). Returns
* true if any of the $needles are found in the $haystack, or false if not found.
*
* Example:
* list-key-exists((value1 value2 value3), 'value1') => true
* list-key-exists((value1 value2 value3), (thing, value1)) => true
* list-key-exists((value1 value2 value3), 'nothere') => false
*/
@function list-key-exists($haystack, $needles) {
@BPScott
BPScott / programes_breakpoints.scss
Created July 11, 2013 12:48
The breakup breakpoints in the /programmes responsive rework
/**
* Generic media query breakpoints, common useful breakpoints.
*
* These breakpoints specify the points at which the grid is likely to require
* reflowing. This allows us to declaratively define grid size transitions by
* adding multiple classes to an element.
*
* These grid sizings are based off the GEL responsive grid and font
* breakpoints. GEL's grid is 972px wide with 16px padding, giving a total page
* width of 1008px wide.
@BPScott
BPScott / SassMeister-input.scss
Created November 5, 2013 14:15
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
// Taken from https://github.com/heygrady/scss-blend-modes/blob/master/stylesheets/_blend-modes.scss
@function blend-normal ($foreground, $background) {
$opacity: opacity($foreground);
$background-opacity: opacity($background);
@BPScott
BPScott / SassMeister-input.scss
Created November 5, 2013 14:15
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
// Taken from https://github.com/heygrady/scss-blend-modes/blob/master/stylesheets/_blend-modes.scss
@function blend-normal ($foreground, $background) {
$opacity: opacity($foreground);
$background-opacity: opacity($background);