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 Fibonnaci | |
include Enumerable | |
def initialize | |
@a = @b = 1 | |
end | |
def each | |
loop do | |
yield @a |
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 Example | |
def make_method(&block) | |
@block = block | |
end | |
def dynamic_method(n) | |
@block.call(n) if @block | |
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
class klass { | |
file { ['/tmp/a']: ensure => present } | |
} | |
define def_file() { | |
include klass | |
file { $name: | |
ensure => present, | |
require => File['/tmp/a'] |
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
Oct 15 12:59:10 <chuck> defunkt: do you think you guys could share your capistrano tasks for unicorn also? | |
Oct 15 13:01:23 --> drev1 (n=reverri@dcn242-239.dcn.davis.ca.us) has joined #github | |
Oct 15 13:03:44 <-- anteaya has quit (Read error: 131 (Connection reset by peer)) | |
Oct 15 13:06:17 <defunkt> chuck: namespace(:unicorn) { task(:stop) { sudo "god unicorn stop" } } | |
Oct 15 13:06:21 <defunkt> repeat for restart and start |
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
test AptPreferences.lns put "" after | |
set "/1/Package" "something-funny"; | |
set "/1/Pin" "version"; | |
set "/1/Pin/version" "1.2.3-4"; | |
set "/1/Pin-Priority" "2000" | |
= "Package: something-funny | |
Pin: version 1.2.3-4 | |
Pin-Priority: 2000 | |
" |
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
$ apt-cache show heartbeat-common | |
Package: heartbeat-common | |
Priority: optional | |
Section: admin | |
Installed-Size: 1904 | |
Maintainer: Debian HA Maintainers <debian-ha-maintainers@lists.alioth.debian.org> | |
Architecture: amd64 | |
Source: heartbeat | |
Version: 2.99.2+sles11r9-6 | |
Replaces: heartbeat (<= 2.99.2+sles11r9-2) |
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
#!/usr/bin/env ruby | |
require 'openssl' | |
require 'digest/sha1' | |
def main(argv) | |
if argv.empty? | |
$stderr.puts <<-EOF.gsub("\t\t\t", '') | |
Please provide at least one key/cert/csr file. | |
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
String lat = "12345.67"; | |
int decpoint = lat.indexOf("."); | |
String min = lat.substring(decpoint - 2); | |
String deg = lat.substring(0, decpoint - 3); | |
Double latitude = Double.valueOf(deg) + Double.valueOf(min) / 60; |
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"?> | |
<TableLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent"> | |
<TableRow> | |
<TextView android:text="Label:" /> | |
<EditText android:id="@+id/editable" | |
android:ems="3" /> | |
</TableRow> |
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
FROM ubuntu:14.04 | |
ADD hup-me-harder sbin/hup-me-harder | |
ENTRYPOINT ["/sbin/hup-me-harder"] |
OlderNewer