This file contains hidden or 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
require 'open3' | |
$CR = "\033[0m" # color reset | |
$red = "\033[1m\033[31m" | |
$green = "\033[1m\033[32m" | |
$yellow = "\033[1m\033[33m" | |
$blue = "\033[1m\033[34m" | |
ssh_options[:forward_agent] = true | |
ssh_options[:paranoid] = false |
This file contains hidden or 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
-- typical adjacent list table (parent/child) | |
CREATE TABLE `attribute` ( | |
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | |
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, | |
`parent_id` bigint(20) unsigned DEFAULT NULL, | |
PRIMARY KEY (`id`), | |
KEY `parent_id_idx` (`parent_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; | |
-- typical closure structure |
This file contains hidden or 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
SELECT DISTINCT pilot_name | |
FROM PilotSkills AS PS1 | |
WHERE NOT EXISTS | |
(SELECT * | |
FROM Hangar | |
WHERE NOT EXISTS | |
(SELECT * | |
FROM PilotSkills AS PS2 | |
WHERE (PS1.pilot_name = PS2.pilot_name) | |
AND (PS2.plane_name = Hangar.plane_name))); |
This file contains hidden or 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 | |
# | |
# Original for 5.3 by Ruben Barkow (rubo77) http://www.entikey.z11.de/ | |
# release 1 PHP5.4 to 5.3 by Emil Terziev ( foxy ) Bulgaria | |
# Originally Posted by Bachstelze http://ubuntuforums.org/showthread.php?p=9080474#post9080474 | |
# OK, here's how to do the Apt magic to get PHP packages from the precise repositories: | |
echo "Am I root? " | |
if [ "$(whoami &2>/dev/null)" != "root" ] && [ "$(id -un &2>/dev/null)" != "root" ] ; then |
This file contains hidden or 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
# List name vhosts on current server (excludes aliases) | |
sudo apache2ctl -S 2>&1 | grep -v 'Syntax OK' | grep 'namevhost' | tr -s ' ' | cut -d' ' -f5 | |
# List all vhosts and aliases on current server | |
THECONFS="`apache2ctl -S 2>&1 | grep -oE '\/[^\:]+' | grep -vE '^\s*#'`"; for ACONF in ${THECONFS}; do cat ${ACONF} | tr '\t' ' ' | grep -E '^ *(ServerName|ServerAlias)' | sed -r 's/^( |ServerName|ServerAlias)+//g' | tr ' ' '\n'; done | sort -fu |
This file contains hidden or 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
curl -i -X PROPFIND --user 'user:pass' https://someserver.com/webdav/Sites/Logs/ --upload-file - -H "Depth: 1" <<end | |
<?xml version="1.0"?> | |
<a:propfind xmlns:a="DAV:"> | |
<a:prop><a:resourcetype/></a:prop> | |
<a:prop><a:getlastmodified/></a:prop> | |
</a:propfind> | |
end |
This file contains hidden or 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
/** | |
* PostalCode.ds | |
*/ | |
importPackage( dw.system ); | |
importScript("utils/Underscore.ds"); | |
var _ = getUnderscore(); | |
function PostalCode() {} |
This file contains hidden or 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 'dart:html' show Console; | |
void main() { | |
var console = new Console(); | |
console.log("ok ab dart!"); | |
} | |
// to compile use: | |
// dart2js -oab.js ab.dart |
This file contains hidden or 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
// boot code for jasmine, require paths were customized for my env | |
// on my commonjs server, added boot.js as the main file of mod_jasmine, which is wrapping my copy of jasmine-core node package | |
var jasmineRequire = require('mod_jasmine/jasmine-core/lib/jasmine-core/jasmine.js'); | |
var jasmine = jasmineRequire.core(jasmineRequire); | |
var consoleFns = require('mod_jasmine/jasmine-core/lib/console/console.js'); | |
extend(jasmineRequire, consoleFns); | |
jasmineRequire.console(jasmineRequire, jasmine); | |
var env = jasmine.getEnv(); |
This file contains hidden or 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 zsh | |
branch=`git rev-parse --abbrev-ref HEAD` | |
git show-branch | ack '\*' | ack -v "$branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//' | |
# How it works: | |
# 1| Display a textual history of all commits. | |
# 2| Ancestors of the current commit are indicated | |
# by a star. Filter out everything else. |