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 ( | |
"fmt" | |
"github.com/alexcesaro/mail/gomail" | |
"net/smtp" | |
) | |
type Email struct { | |
From string |
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 ( | |
"fmt" | |
"gopkg.in/redis.v2" | |
"time" | |
) | |
const ( | |
Subscription int = iota |
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 ( | |
"fmt" | |
ini "github.com/vaughan0/go-ini" | |
"os" | |
) | |
const File = "test.ini" |
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 Kernel | |
def suppress_warnings | |
original_verbosity = $VERBOSE | |
$VERBOSE = nil | |
result = yield | |
$VERBOSE = original_verbosity | |
return result | |
end | |
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
package main | |
import ( | |
"errors" | |
"fmt" | |
"github.com/takama/daemon" | |
"log" | |
"os" | |
"os/signal" | |
"syscall" |
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 ( | |
"fmt" | |
"github.com/kr/beanstalk" | |
"os" | |
"time" | |
) | |
func main() { |
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
// based based on | |
// http://www.lucaongaro.eu/blog/2012/12/02/easy-two-way-data-binding-in-javascript/ | |
function PropBack() { | |
var prop = [ | |
{ name: 'value', callback: function(obj, content) { jQuery(obj).val(content); } }, | |
{ name: 'html', callback: function(obj, content) { jQuery(obj).html(content); } }, | |
{ name: 'text', callback: function(obj, content) { jQuery(obj).text(content); } }, | |
{ name: 'title', callback: function(obj, content) { jQuery(obj).attr('title', content); } }, | |
{ name: 'name', callback: function(obj, content) { jQuery(obj).attr('name', content); } }, |
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
/path/to/log/file.log { | |
daily | |
compress | |
postrotate | |
kill -HUP `cat /path/to/app/tmp/puma/puma.pid` | |
endscript | |
} |
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
def check_s_client | |
server = 'Generel Settings: ' | |
renegotiation = 'Insecure Renegotiation'.colorize(:red) | |
crime = 'SSL Compression Enabled <= CRIME - CVE-2012-4929'.colorize(:red) | |
results = %x(echo "q" | openssl s_client -host #{@server} -port #{@port} 2> /dev/null) # why ? | |
case results.downcase | |
when 'secure renegotiation is supported' | |
renegotiation = 'Secured Renegotiation'.colorize(:green) | |
when 'compression: none' |
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
def to_file(*block) | |
raise ArgumentError.new('You must use block') unless block_given? | |
f = open('/tmp/to_file', 'a+') | |
yield f | |
f.close | |
end | |
to_file do |f| | |
f.puts 'Hello World' | |
end |