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
;; That will actually catch exception within inner thread, too. And within inner thread of inner thread. Etc. | |
(Thread/setDefaultUncaughtExceptionHandler (proxy [Thread$UncaughtExceptionHandler] [] | |
(uncaughtException [t e] | |
;; | |
;; Your fancy Exception logging here | |
;; | |
(println "Throwable: " + (.getMessage e)) | |
(println (.toString t))))) | |
(.start (Thread. (cast Runnable | |
(fn [] |
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
HOST = # masked | |
SOURCE_PORT = 5672 | |
DESTINATION_PORT = 5672 | |
USERNAME = ifesdjeen | |
createTunnel() { | |
/usr/bin/ssh -f -N -L$SOURCE_PORT:$HOST:$DESTINATION_PORT -L19922:HOST:22 ifesdjeen@$HOST | |
if [[ $? -eq 0 ]]; then | |
echo Tunnel to $HOST created successfully | |
else |
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
(defn wrap-fn | |
"Wrap or replace some function with your own function" | |
[qualifier wrapper] | |
(alter-var-root | |
qualifier | |
(fn [original-fn] | |
(fn [& caller-arguments] | |
(wrapper caller-arguments original-fn))))) | |
;; Replace your function implementation: |
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/sh | |
PATH=/bin:/usr/bin:/sbin:/usr/sbin | |
DAEMON=/a/my-app/current/run.sh | |
PIDDIR=/a/my-app/current/tmp/pids | |
PIDFILE="$PIDDIR/my-app.pid" | |
USER="myuser" | |
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin" |
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
module SafeConstDefinition | |
extend ActiveSupport::Concern | |
module ClassMethods | |
def const_missing(name) | |
puts "Warning: #{name} was not defined, assuming further definition. Keep calm tho." | |
# Since Parent is defined after Child both in root and in SomeModule, | |
# i need to have a mechanism to define a future const, but simple: |
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
# -*- coding: utf-8 -*- | |
require 'rubygems' | |
require 'capybara' | |
require 'capybara/dsl' | |
Capybara.run_server = false | |
Capybara.default_driver = :selenium | |
Capybara.app_host = 'http://iknow.jp' | |
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
============================================ | |
I have kicked myself mentally a hundred times for that stupidity and don't think I'll ever really, finally get | |
over it. Evidently what I saw sloshing around was gas in the reserve tank which I had never turned on. I didn't | |
check it carefully because I assumed the rain had caused the engine failure. I didn't understand then how foolish | |
quick assumptions like that are. Now we are on a twenty-eight-horse machine and I take the maintenance of it very | |
seriously. | |
============================================ | |
I found the cause of the seizures a few weeks later, waiting to happen again. It was a little twenty-five-cent | |
pin in the internal oil-delivery system that had been sheared and was preventing oil from reaching the head at | |
high speeds. |
NewerOlder