Skip to content

Instantly share code, notes, and snippets.

View dinamic's full-sized avatar
😳
I would rewrite the world, but they won't give me the source code.

Nikola Petkanski dinamic

😳
I would rewrite the world, but they won't give me the source code.
View GitHub Profile
/**
* @When I scroll :elementId into view
*/
public function scrollIntoView($elementId) {
$function = <<<JS
(function(){
var elem = document.getElementById("$elementId");
elem.scrollIntoView(false);
})()
JS;
@dinamic
dinamic / stub-properties-and-methods-sinon.js
Created February 4, 2016 21:11 — forked from jouni-kantola/stub-properties-and-methods-sinon.js
Sinon.JS used to stub properties and methods in a sandbox. Methods and properties are restored after test(s) are run.
define(['can', 'localCache'], function(can, localCache) {
'use strict';
describe('storeLocal()', function() {
var sandbox;
beforeEach(function() {
// create sandbox environment for mocking about
sandbox = sinon.sandbox.create();
});
@dinamic
dinamic / gist:2f2aa3387d5a3ab776ab
Created December 16, 2015 12:34 — forked from saetia/gist:1623487
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
<?php
/**
* Transforms an under_scored_string to a camelCasedOne
*/
function camelize($scored) {
return lcfirst(
implode(
'',
array_map(
<?php
/**
* This class can add WSSecurity authentication support to SOAP clients
* implemented with the PHP 5 SOAP extension.
*
* It extends the PHP 5 SOAP client support to add the necessary XML tags to
* the SOAP client requests in order to authenticate on behalf of a given
* user with a given password.
*
<?php
/**
* FinalKeywordIgnoredInTrait.php
*
* PHP 5.4.13 (cli) (built: Mar 15 2013 02:05:59)
* Copyright (c) 1997-2013 The PHP Group
* Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
* with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans
*
* @link https://bugs.php.net/bug.php?id=62204
http://nvie.com/posts/a-successful-git-branching-model/