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
<input type="text" ng-focus="focusCallback($event)" ng-change="changeCallback()"> |
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
// Go through each of the rows on the permissin table | |
rows = jQuery('#permissions tr'); | |
rows.each(function() { | |
// Get the first checkbox in the row. | |
checkbox = jQuery('.checkbox .form-checkbox', this).first(); | |
// Get the first cell, containing the permission label. | |
nameCell = jQuery('td:first-child', this); | |
// In case this is not a permission row | |
if(checkbox.length == 0) { | |
return; |
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
var checked = []; | |
$("input[name='items[]']:checked").each(function () { | |
checked.push($(this).val()); | |
}); |
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/python | |
# Run with: | |
# python hello.py cameron | |
# python hello.py | |
# import modules used here -- sys is a very standard one | |
import sys | |
import subprocess |
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/sh | |
# Explained at https://stackoverflow.com/questions/36781372/docker-using-gosu-vs-user#37931896 | |
set -x | |
# get gid of docker socket file | |
SOCK_DOCKER_GID=`ls -ng /var/run/docker.sock | cut -f3 -d' '` | |
# get group of docker inside container | |
CUR_DOCKER_GID=`getent group docker | cut -f3 -d: || true` |
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 | |
function HOOK_menu_alter(&$items) { | |
$search = 'node/'; | |
foreach ($items as $path => $options) { | |
if(strpos($path, $search) === 0) { | |
drupal_set_message('<strong>' . $path . '</strong><pre>'.var_export($options, TRUE).'</pre>', 'status', FALSE); | |
} | |
} | |
} |
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 | |
if [ -z "$2" ];then | |
echo "We need two parameters, boet." | |
echo " Usage: $FUNCNAME vagrant-name vbox-machine-name" | |
return 1 | |
fi | |
export lowername=$2 | |
export tempdir=createvmbox.$((RANDOM)) |
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 | |
module_load_include('module', 'image'); | |
$styles = array_keys(image_styles()); | |
image_style_flush($styles); | |
drupal_set_message(t('Flushed images for the following styles: %styles.', array('%styles' => implode(', ', $styles))), 'status', FALSE); |
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
div.panel-pane div.admin-links { | |
font-size: 100%; | |
position:relative; | |
width:100%; | |
} | |
div.panel-pane div.admin-links li { | |
padding-bottom: 0; | |
} |
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
import sublime, sublime_plugin, os, subprocess | |
class ConemuCommand(sublime_plugin.TextCommand): | |
def run(self, edit): | |
if os.name == "nt": | |
startupinfo = subprocess.STARTUPINFO() | |
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW | |
process = subprocess.Popen(('c:/Program Files (x86)/ConEmu/ConEmu.exe', '/single', self.view.file_name()), |
NewerOlder