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
$ cat irc.rb | |
require 'haml' | |
template = <<EOF | |
- if false | |
%p In the if | |
- else | |
%p In the else | |
EOF |
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 Array | |
# Get a one-dimensional array by combining elements of nested arrays. | |
# | |
# ==== Examples | |
# | |
# [[3, 4], 5, [[6, 7, 8], 9]] #=> [3, 4, 5, 6, 7, 8, 9] | |
# | |
def my_flatten | |
result = [] |
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/perl | |
use 5.014; | |
use Cwd; | |
use File::Temp (); | |
use File::Spec; | |
my $file = $ARGV[0] or die "Provide a file to convert.\n"; | |
my $tempdir = File::Temp->newdir; | |
my $profile = File::Spec->catdir($tempdir, "profile"); |
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
import json | |
import logging | |
def recursive_dict(obj, converted_objs=()): | |
converted_objs = converted_objs or set() | |
try: | |
attrs = obj.__dict__ | |
except AttributeError: | |
if isinstance(obj, dict): |
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
import sys | |
import time | |
from polymer import Polymer | |
class NullStatusDisplayer(object): | |
def show_status(self): | |
pass |
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
An execution plan has been generated and is shown below. | |
Resource actions are indicated with the following symbols: | |
+ create | |
Terraform will perform the following actions: | |
# aws_instance.example will be created | |
+ resource "aws_instance" "example" { | |
+ ami = "ami-2757f631" |