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 node | |
/*! | |
* CSS: The Next Generation | |
* | |
* Copyright (c) 2017 Atelier Disko. All rights reserved. This source | |
* code is distributed under the terms of the BSD 3-Clause License. | |
*/ | |
const fs = require('fs'); | |
const postcss = require('postcss'); |
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 | |
dir=$1 | |
old=$2 | |
files=$(ack -l "Copyright $old") | |
for f in $files; do | |
year=$(git log --follow -M -C --format=%ad --date=format:%Y $f | tail -1) | |
echo "$year : $f" |
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 | |
namespace app\extensions\helper; | |
class Form extends \lithium\template\helper\Form { | |
public function field($name, array $options = array()) { | |
$options += [ | |
'class' => null, | |
'type' => isset($options['list']) ? 'select' : 'text', |
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 | |
# Fill in your connection details. | |
DATABASE="blog" | |
COLLECTION="posts" | |
USER="" | |
PASS="" | |
# | |
AUTH="" |
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 | |
# | |
# Continuously checks online/offline status and notifies | |
# you when the status changes. Works only where the "say" | |
# command is available. | |
# | |
# Dedicated to the public domain. | |
# | |
last= |
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 | |
use lithium\net\http\Media; | |
$injectDataIntoElements = function(array $elements = [], array $data = []) { | |
Media::applyFilter('view', function($self, $params, $chain) use ($elements, $data) { | |
$view = $chain->next($self, $params, $chain); | |
$view->applyFilter('_step', function($self, $params, $chain) use ($elements, $data) { | |
$whitelisted = in_array($params['params']['template'], $elements); |
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 | |
# | |
# Language agnostic GIT pre commit hook. | |
# | |
# Copyright (c) 2013 Marius Wilms. | |
# All rights reserved. | |
# | |
# Distributed under the terms of the BSD 3-clause license. Redistributions | |
# of this file must retain the above copyright notice. For the full license | |
# text see: http://opensource.org/licenses/BSD-3-Clause. |
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 | |
/** | |
* Reusable Copyright Element for Lithium. | |
* | |
* Works without passing any options at all (except the `holder`), will make | |
* "smart" guesses. Allows customization by passing strings for `holder`, `object` | |
* or years for `begin` and `end`. | |
* | |
* Example Usage: | |
* ``` |
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 | |
public function beforeDelete($cascade = true) { | |
if (!$cascade) { | |
return true; | |
} | |
$result = $this->find('first', array( | |
'conditions' => array($this->primaryKey => $this->id), | |
'fields' => array('dirname', 'basename'), | |
'recursive' => -1 |
NewerOlder