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 | |
/** | |
* Implements template_preprocess_block() for facet blocks. | |
*/ | |
function THEMENAME_preprocess_block__facet_block(&$variables) { | |
$facet = $variables['content'][0]['#facet']; | |
if ($facet->getActiveItems()) { | |
$variables['details_open'] = TRUE; |
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 bash | |
# Install any build dependencies needed for curl | |
sudo apt-get build-dep curl | |
# Get latest (as of Feb 25, 2016) libcurl | |
mkdir ~/curl | |
cd ~/curl | |
wget http://curl.haxx.se/download/curl-7.65.2.tar.bz2 | |
tar -xvjf curl-7.65.2.tar.bz2 |
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
{ | |
"workbench.startupEditor": "newUntitledFile", | |
"workbench.colorTheme": "One Dark Pro", | |
"workbench.iconTheme": "material-icon-theme", | |
"window.zoomLevel": 1, | |
"typescript.check.npmIsInstalled": false, | |
"editor.tabSize": 2, | |
"editor.insertSpaces": true, | |
"editor.acceptSuggestionOnEnter": "smart", | |
"explorer.confirmDragAndDrop": 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
_..--+~/@-@--. | |
_-=~ ( . ) | |
_-~ _.--=.\ \'''' | |
_~ _- \ \_\ | |
= _= '--' | |
' = . | |
: : '=_. ___ | |
| ; '~--.~. | |
; ; } | | |
= \ __..-...__ ___/__/__ |
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 | |
# Sets the deceleration constant for Razer Turret. | |
deceleration_constant=2.5 | |
name="Razer Razer Turret Dongle" | |
for id in $(xinput --list | awk -F= "/$name.*pointer/ {print \$2}" | cut -f1) | |
do | |
xinput --set-prop $id "Device Accel Constant Deceleration" $deceleration_constant | |
done |
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 | |
/** | |
* HTML mail backend. | |
*/ | |
class CustomMailSystem implements MailSystemInterface { | |
/** | |
* | |
* @param $message | |
* A message array, as described in hook_mail_alter(). |
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
class Place | |
attr_accessor :name | |
attr_accessor :phrases | |
attr_accessor :left_place | |
attr_accessor :right_place | |
def initialize(name, initial_phrases) | |
@name = name | |
@phrases = initial_phrases | |
@left_place = nil | |
@right_place = nil |
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 | |
$latest_title = ''; | |
$latest_link = ''; | |
$blog_posts = array(); | |
// change this depending on your installation location and folder name | |
foreach (glob(dirname(__FILE__) . '/statamic/_content/01-blog-entries/*-*-*.md') as $blog_filepath) { | |
$pathinfo = pathinfo($blog_filepath); | |
$blog_posts[$pathinfo['filename']] = $blog_filepath; | |
} |
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 | |
$file = Yii::app()->params->uploadedDynamicsCsvFile; | |
$handle = fopen($file, 'r'); | |
$row = array(); | |
$field_data = ''; // field contents buffer | |
$carry = 0; // row has even/odd quotes; carry bit | |
while (!feof($handle)) { | |
$contents = fgets($handle); |
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
/** | |
* Find all lists, and if there's more than 10 list items, split it. | |
* Requires the Modernizr library for the check. | |
*/ | |
$('.content ul').each(function(){ | |
if ($(this).children('li').length > 10) { | |
// if CSS3 columns is allowed, add a css class. | |
if (Modernizr.testAllProps('columnWidth') && Modernizr.testAllProps('columnGap')) { | |
$(this).addClass('two-column-list'); | |
} else { |