Skip to content

Instantly share code, notes, and snippets.

/*
html2canvas 0.5.0-beta2 <http://html2canvas.hertzen.com>
Copyright (c) 2015 Niklas von Hertzen
Released under MIT License
*/
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.html2canvas = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
/*! https://mths
#! /usr/bin/env perl
# create m3u file for banshee playlist
use warnings;
use strict;
use DBI;
use File::Basename;
use Getopt::Long;
use IO::File;
use Pod::Usage;
<?php
class Select2Context{
public function iCompleteSelect2($term, $field, $entry)
{
if (!($driver = $this->getDriver()) instanceof Selenium2Driver) {
throw new \InvalidArgumentException('Don\'t use select2 in non-selenium env');
}
$this->openField($field);
$this->fillSearchField($field, $term);
@akovalyov
akovalyov / test.php
Created August 4, 2015 21:51
Snappy with multiple URLs
<?php
require_once 'vendor/autoload.php';
$pdf = new \Knp\Snappy\Pdf();
$pdf->setBinary('/home/andrew/.composer/vendor/bin/wkhtmltopdf-amd64');
file_put_contents('test.pdf', $pdf->getOutput(array('http://github.com', 'http://gist.github.com')));
@akovalyov
akovalyov / .travis.yml
Created May 28, 2015 11:29
Travis email on failure with screenshots and everything you want
after_failure:
- sudo apt-get update && sudo apt-get install mutt
- echo "Something failed" | mutt $( printf -- '-a %q ' build/screenshots/*.png ) -s "Travis fail" -- recipient@domain.tld
@akovalyov
akovalyov / .editorconfig
Created May 20, 2015 12:10
Editor config for Symfony2 project
; top-most EditorConfig(editorconfig.org) file
root = true
[*]
end_of_line = LF
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8
@akovalyov
akovalyov / File.orm.yml
Created May 18, 2015 08:12
Pure file upload with Doctrine entity listener, doctrine events and symfony2 dependency injection
App\Model\File:
type: entity
table: files
entityListeners:
App\Doctrine\EventListener\FileUploadListener:
prePersist: [upload]
preUpdate: [upload]
preRemove: [remove]
id:
id:
@akovalyov
akovalyov / console.php
Last active August 29, 2015 14:21
Symfony2 console with docker
#!/usr/bin/env php
<?php
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
//umask(0000);
set_time_limit(0);
const DOCKER_CONTAINER_NAME = 'app_phpfpm_1';
@akovalyov
akovalyov / gnome-screenshot
Created April 9, 2015 20:41
Take screenshot, upload it to your owncloud instance immediately, set share time to 24 hours and push the link of the shared screenshot to the clipboard. It assumes that you move the original gnome-screenshot tool from /usr/bin/gnome-screenshot to /usr/bin/gnome-screenshot.bin and put this shell script to /usr/bin/gnome-screeshot. Sorry, there i…
#!/bin/bash
USER="!!!USER!!!" #changeme
PASSWORD="!!!PASSWORD!!!" #changeme
URL="!!!DOMAIN!!!" #changeme
SCHEME="!!!https or http!!!" #changeme
SCREENS_DIR=Screenshots #changeme or not
YEAR=$(date +"%Y")
NOW=$(date +"%m_%d_%s")
@akovalyov
akovalyov / FeatureContext.php
Created July 23, 2014 23:07
Behat redirects
<?php
namespace Context;
use Behat\Behat\Context\Context;
use Behat\Behat\Context\SnippetAcceptingContext;
use Knp\FriendlyContexts\Context\RawPageContext;
class FeatureContext extends RawPageContext implements Context, SnippetAcceptingContext
{