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
-- CREATE (n:Actor { name:"Tom Hanks" }); | |
WITH | |
n AS ( | |
INSERT INTO node (properties) VALUES ('name=>Tom Hanks') RETURNING id | |
) | |
INSERT INTO node_label VALUES (n.id, 'Actor'); | |
-- MATCH (actor:Actor { name: "Tom Hanks" }) | |
-- RETURN actor; | |
WITH |
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
irb(main):001:0> a = Enumerator.new { |output| i = 0; loop { output << i = i.next } } | |
=> #<Enumerator: #<Enumerator::Generator:0x007f8014012818>:each> | |
irb(main):002:0> a.next | |
=> 1 | |
irb(main):003:0> a.next | |
=> 2 | |
irb(main):004:0> a.next | |
=> 3 |
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
try | |
{ | |
// Something | |
} | |
catch (error) | |
{ | |
var spoon = Packages.org.pentaho.di.core.gui.SpoonFactory.getInstance(); | |
spoon.messageBox( | |
error.message, error.name, | |
true, Packages.org.pentaho.di.core.Const.INFO |
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
# GOOD: cc03053 | |
# BAD: 408174f | |
git bisect start 408174f cc03053 | |
git bisect run ./test-stash-0.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
module Virtus::ValueObject | |
def self.new(super_class = Object, &block) | |
result = Class.new(super_class) | |
result.class_exec(&block) | |
result.include(Equalizer.new(*result.attribute_set.map(&:name))) | |
end | |
end | |
MyClass = Virtus::ValueObject.new do | |
attribute ... |
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
# Ruby-esque pseudocode | |
def transfer_money_between_accounts(acct1, acct2, amount) | |
puts "Source balance is: #{acct1.balance}" | |
puts "Destination balance is: #{acct2.balance}" | |
acct1.balance -= amount | |
acct2.balance += amount | |
puts "Source balance is now: #{acct1.balance}" |
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
require 'benchmark' | |
require 'delegate' | |
class DecorateUser | |
end | |
class RunnerDecorator < DelegateClass(DecorateUser) | |
def initialize(user) | |
super user | |
end |
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 | |
MODEM_HOST="Cable Modem" | |
MODEM_IP="192.168.100.1" | |
SIGNAL_URL="http://$MODEM_IP/RgSignal.asp" | |
ZABBIX_SERVER="127.0.0.1" | |
curl --silent "$SIGNAL_URL" | | |
sed -n -e ' | |
/Downstream/,/Upstream/ { |
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 | |
# Run tools on files in the index | |
git diff --cached --name-status \ | |
| awk '$1 != "D" && $1 != "R" { $1 = ""; print }' \ | |
| git checkout-index --stdin --temp \ | |
| while read tmp orig | |
do | |
case $orig in | |
*.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
diff --git a/classes/kohana/config/database/reader.php b/classes/kohana/config/database/reader.php | |
index 9366a2a..f9899dd 100644 | |
--- a/classes/kohana/config/database/reader.php | |
+++ b/classes/kohana/config/database/reader.php | |
@@ -53,7 +53,7 @@ class Kohana_Config_Database_Reader implements Kohana_Config_Reader | |
* | |
* @link http://dev.kohanaframework.org/issues/4316 | |
*/ | |
- if ($group === 'database') | |
+ if ($group === Database::CONFIG) |