Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am brianjhanson on github.
  • I am brianjhanson (https://keybase.io/brianjhanson) on keybase.
  • I have a public key ASDJ1n7E_b5ARc1pW57hrpJ5LklEBkW6Ef8PzJiLNmsZiQo

To claim this, I am signing this object:

/** VERSION: 2.2.3 Please don't modify or unzip this content. It will be updated regularly **/
function BCSfFilterCallback(a) {
bcsffilter.afterGetFilterData(a, a.event_type)
}
function viewMoreFilterOption(a) {
var b = "." + bcsffilter.class.filterBlockContent,
c = "." + bcsffilter.class.filterOptionViewMoreList;
@brianjhanson
brianjhanson / Contract Killer 3.md
Last active June 25, 2018 01:39
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

Between Brian Hanson

@brianjhanson
brianjhanson / faq-scrape.js
Last active September 8, 2017 20:13
Scrape FAQs
var $questions = jQuery('.faq-question');
var json = {};
json.categories = [];
json.entries = [];
var categoryIndex = -1;
var sectionId = 21;
var typeId = 28;
function isFirst(string) {
return (string.search(/^1\./g) !== -1);
@brianjhanson
brianjhanson / task-config.js
Created July 9, 2017 17:21
Example of adding CSS globbing to Vigor's blendid
var nodeSassGlobbing = require('node-sass-globbing');
module.exports = {
images : true,
fonts : true,
svgSprite : true,
stylesheets : {
sass: {
includePaths: ["./node_modules"], // from default, but we still want it
// Not sure why we have to split this into a function, but we seem to need to
@brianjhanson
brianjhanson / BasePlugin.php
Created June 15, 2017 18:01
Importing Categories, Matrix fields and Super Table fields with Craft Import
<?php
/**
* Modify data just before importing
*
* @param BaseElementModel $element The current element receiving import data.
* @param array $map Mapping of data between CSV -> Craft fields.
* @param array $data Raw data provided for this row.
*/
public function modifyImportRow($element, $map, $data)
{
@brianjhanson
brianjhanson / Craft3ValetDriver.php
Created June 2, 2017 02:53
Valet Driver for Craft 3
<?php
class Craft3ValetDriver extends ValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
@brianjhanson
brianjhanson / profile-summary-firebug.php
Last active November 29, 2016 23:08
More useful output of craft profiling console
<script type="text/javascript">
/*<![CDATA[*/
if (typeof(console) == 'object' && typeof console.groupCollapsed == 'function')
{
console.groupCollapsed("Profiling Summary Report");
console.log("Time: <?php echo sprintf('%0.5f', Craft\Craft::getLogger()->getExecutionTime()); ?>s\n");
console.log("Memory: <?php echo number_format(Craft\Craft::getLogger()->getMemoryUsage() / 1024); ?>Kb\n");
console.log("Total Queries: <?php echo is_array($data) ? count($data) : '0'; ?>\n");
<?php
@brianjhanson
brianjhanson / SassMeister-input.scss
Created August 25, 2015 21:38
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$spacing: (
xs: 2.5rem,
s: 4rem,
m: 6rem,
l: 8rem,
xl: 10rem
/* ==============================================================
Text
============================================================== */
//---------------------------------------------------------------
// Base
//---------------------------------------------------------------