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
class A | |
attr_reader :b | |
def initialize | |
@b = B.new | |
end | |
end | |
class B | |
attr_reader :c |
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 EnvironmentCheck | |
MESSAGE = "This action is destructive. Proceed?" | |
def self.execute(message = MESSAGE) | |
return command_line_output unless inquiry(message) == 'y' | |
yield if block_given? | |
end | |
private |
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 mrkplt on github. | |
* I am mrkplt (https://keybase.io/mrkplt) on keybase. | |
* I have a public key whose fingerprint is B63F B8E1 BE81 FBAF E770 6DB7 2D7F 0EBC 0074 AC2E | |
To claim this, I am signing this object: |
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
package main | |
import ( | |
"net/http" | |
"github.com/mrkplt/end_point/models" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
w.Header().Set("Content-Type", "application/json") |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>com.mrkplt.sockfix</string> | |
<key>Program</key> | |
<string>/bin/ln</string> | |
<key>ProgramArguments</key> | |
<array> |
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
$ rails new <app_name> --skip-test-unit | |
$ cd <app_name>/ | |
$ git init | |
$ git add . | |
$ git commit -m 'first commit' | |
$ git remote add origin <git repo> | |
$ git push -u origin master | |
$ mate . | |
/** |
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 | |
### BEGIN INIT INFO | |
# Provides: unicorn | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the unicorn web server | |
# Description: starts unicorn |
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 'net/ldap' | |
require 'io/console' | |
class LDAPUser | |
def connect(user_name, password) | |
ldap = Net::LDAP.new(:host => 'example.com', :port => 389) | |
ldap.auth("CN=#{user_name},OU=Users,DC=example,DC=com", password) | |
begin |
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
<snippet> | |
<content><![CDATA[ | |
do | |
${1} | |
end]]></content> | |
<description>do...end block</description> | |
<tabTrigger>doe</tabTrigger> | |
<scope>source.ruby</scope> | |
</snippet> |
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
hello = 'Hello' | |
puts Process.pid | |
while true | |
Signal.trap('USR1'){ | |
hello = 'HALLO!' | |
} | |
Signal.trap('USR2'){ | |
hello = 'Hello' | |
} |