View querySelector.polyfill.js
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
if (!document.querySelectorAll) { | |
document.querySelectorAll = function (selectors) { | |
var style = document.createElement('style'), elements = [], element; | |
document.documentElement.firstChild.appendChild(style); | |
document._qsa = []; | |
style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}'; | |
window.scrollBy(0, 0); | |
style.parentNode.removeChild(style); |
View js_filename.js
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
/** | |
* __defineGetter__ - IE9+ | |
* new Error - IE10+ | |
*/ | |
window.__defineGetter__('__FILE__', function() { | |
return (new Error).stack.split('/').slice(-1).join().split('.')[0]; | |
}); | |
console.log(__FILE__); // js_filename |
View update-sources-branch.sh
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 | |
# Move contents from this subdirectory into root directory of a repository. | |
# - Any relative directory could be as a value. | |
# - Pass "--default" to keep this value and affect on the next. | |
DIRECTORY="docroot" | |
# Commit moved content in this branch. | |
# - Any name can be specified. Branch will be created. | |
# - Pass "--default" to keep this value and affect on the next. | |
BRANCH="sources" |
View MODULE.module
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 hook_entity_type_alter(). | |
*/ | |
function MODULE_entity_type_alter(array &$entity_types) { | |
/* @var \Drupal\Core\Entity\ContentEntityType $entity_user */ | |
$entity_user = $entity_types['user']; | |
$entity_user->setFormClass('default', \Drupal\MODULE\Entity\User\Form\ProfileForm::class); | |
} |
View vagrant.log
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
INFO global: Vagrant version: 1.9.5 | |
INFO global: Ruby version: 2.2.5 | |
INFO global: RubyGems version: 2.4.5.1 | |
INFO global: VAGRANT_EXECUTABLE="C:\\HashiCorp\\Vagrant\\embedded\\gems\\gems\\vagrant-1.9.5\\bin\\vagrant" | |
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="C:\\HashiCorp\\Vagrant\\embedded" | |
INFO global: VAGRANT_INSTALLER_ENV="1" | |
INFO global: VAGRANT_INSTALLER_VERSION="2" | |
INFO global: VAGRANT_LOG="debug" | |
INFO global: VAGRANT_OLD_ENV_="C:=C:\\cygwin64\\bin" | |
INFO global: VAGRANT_OLD_ENV_ALLUSERSPROFILE="C:\\ProgramData" |
View memcache.sh
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 | |
MEMCACHE_PID=$(\pgrep -f memcache) | |
MEMCACHE_HOST="127.0.0.1" | |
MEMCACHE_PORT="11211" | |
if [ -n "${MEMCACHE_PID}" ]; then | |
# @todo Do we have an ability to use passwordless "sudo"? | |
DATA=$(\sudo \netstat -plunt | \grep "${MEMCACHE_PID}" | \awk '{print $4}' | \head -n1) |
View Vagrantfile
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
VagrantEnv = Vagrant::Environment.new() | |
if "running" == (VagrantEnv.machine_index.find{|machine| machine.vagrantfile_path == VagrantEnv.cwd}).state | |
puts "Machine is running!" | |
end |
View repostat
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 | |
set -e | |
BRANCH="$1" | |
IFS="|" | |
# Show help. | |
if [ "help" == "$BRANCH" ]; then | |
echo "$0 BRANCH" |
View Keybase proof
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
### Keybase proof | |
I hereby claim: | |
* I am br0ken- on github. | |
* I am br0ken (https://keybase.io/br0ken) on keybase. | |
* I have a public key ASDVn9CNGI5gGbGUT2Xd1-FYZX4xR3HlGPYOTWjLPsdOQAo | |
To claim this, I am signing this object: |
View guzzle_gzip_unpack.php
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 | |
// Requirements: | |
// - ext-zlib | |
// - guzzlehttp/guzzle | |
declare(strict_types=1); | |
use GuzzleHttp\Client; | |
use GuzzleHttp\RequestOptions; |
OlderNewer