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
// code from https://github.com/neoascetic/compless | |
// >> .prefix(box-shadow, 5px); | |
// -webkit-box-shadow: 5px; | |
// -moz-box-shadow: 5px; | |
// -ms-box-shadow: 5px; | |
// -o-box-shadow: 5px; | |
// box-shadow: 5px; | |
// | |
// >> .prefix(box-shadow, 5px, webkit ms); |
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
module SCSSLint | |
# Reports lints in an JUnit (XML) format. | |
class Reporter::JUnitReporter < Reporter | |
def report_lints | |
output = "<?xml version=\"1.0\"?>\n" | |
output << "<testsuite name=\"SCSS\" tests=\"#{lints.count}\" failures=\"#{lints.count}\">\n" | |
lints.group_by(&:filename).each do |filename, file_lints| | |
output << "<testcase name=#{filename.encode(xml: :attr)} failures=\"#{file_lints.count}\">\n" |
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
{# Put this file into "admin/auth/user" folder under your templates directory #} | |
{% extends "admin/object_history.html" %} | |
{% load log i18n %} | |
{% block extrastyle %} | |
{{ block.super }} | |
<style>#log { width: 100%; } #log tbody th { width: 16em; }</style> | |
{% endblock %} |
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 | |
/** | |
* To get Code Coverage support, install `xdebug` module. | |
* | |
* Usage: | |
* | |
* php artisan btests directory with/suffix.test.php or/without --env=test | |
* | |
*/ |
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 | |
/** | |
* Class for Laravel 3.x that provides ability to use nested transactions via SAVEPOINTs | |
* (inspired from http://www.kennynet.co.uk/2008/12/02/php-pdo-nested-transactions/). | |
* For now, only the default connection is supported. | |
* | |
* Useful in testing, when you want to start a transaction before running a test | |
* and revert all its changes after it finished. | |
* |
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
'use strict'; | |
var GoL = function () { | |
function touch(ctx, x, y, alive) { | |
ctx[alive ? 'fillRect' : 'clearRect'](x * 11, y * 11, 10, 10); | |
return alive; | |
} | |
function renderDiff(ctx, diff) { | |
for (var d of diff) touch(ctx, d[0], d[1], d[2]); |
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
# On Debian, you need to install these packages: | |
# jpegoptim optipng pngcrush advancecomp | |
import subprocess | |
from os.path import splitext | |
from django.dispatch import receiver | |
from easy_thumbnails.signals import saved_file, thumbnail_created | |
# on-save image optimization |
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 | |
/** | |
* Lazy Paginator for Laravel | |
* Does not use number of pages, simply shows First, Previous and Next links | |
* | |
* Usage: | |
* $pager = LazyPaginator( | |
* Model::where_field($field), // Eloquent, Fluent Query or array of objects | |
* Model::$per_page, |
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
local m = {} | |
m.mods = {} | |
function m.mtime(filepath) | |
local info = love.filesystem.getInfo(filepath) | |
return info and info.modtime | |
end |
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 | |
/** | |
* Bootstrap file for (re)creating database before running tests | |
* | |
* You only need to put this file in "bootstrap" directory of the project | |
* and change "bootstrap" phpunit parameter within "phpunit.xml" | |
* from "bootstrap/autoload.php" to "bootstap/testing.php" | |
*/ |
OlderNewer