Skip to content

Instantly share code, notes, and snippets.

<p>Here is some <code>inline code text</code>, and below is a code box:</p><div class="code">% perl -le 'print "div.code"'<br />% print $shell</div><p><pre><code>% print "This is pre-code" br <br />
% print "no br"
% foo</code></pre></p>
/* a dark style */
* {
background: #303030;
font-family: 'Cousine', monospace;
}
body {
use File::Copy;
copy("file.html","file.html.orig");
open(my $out, ">", "file.html.tmp");
open(my $in, "<", "file.html");
for ( @lines ) {
s/$pattern/${replacement}\n$pattern/g;
say $out $_; #########################################################
@dbb
dbb / gist:1094134
Created July 20, 2011 01:16
and example Config::File file
# This is a comment
# the = should be treated as an operator
# anything before the = is an identifier or name
# anything after it is its value
# anything from a $, @, or % to a \s char is a variable (perl)
identifier = value
name2 = Anything after the \= is the value
# 'name2' => 'Anything after the = is the value'
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
my $string = "This is the real string.";
system 'echo ' . "'" . '$string' . "'" . '> example.txt';
# the command is:
# % echo '$string' > example.txt
#!/usr/bin/zsh
out_html="$HOME/sandbox/pics.html"
top_dir="$HOME/sandbox/pics"
gal="$top_dir/gallery"
header="HEADER TEXT"
footer="FOOTER TEXT"
mklnk() {
--- add_pics_to_html_11.pl.orig 2011-07-25 13:12:25.000000000 -0400
+++ add_pics_to_html_11.pl 2011-07-25 13:26:43.000000000 -0400
@@ -4,6 +4,11 @@
# lots of help by telemachus and dbbolton too
# license: GPL-3
+## all my comments start with a double hash
+## -dbb
+
+## general tips:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
if len(sys.argv) < 2:
sys.exit('Usage: %s [INTEGER]' % sys.argv[0])
try:
n = int( sys.argv[1] )
except ValueError:
<form method="get" action="http://www.google.com/search">
<a href="http://www.google.com/"><img src="favicon.ico" border="0px" /></a>
<input type="text" name="q" size="31" maxlength="255" value="" />
<input type="submit" value="Search" />
<input type="radio" name="sitesearch" value="" checked />Web
<input type="radio" name="sitesearch" value="en.wikipedia.org" />Wikipedia
</form>
<iframe src="http://duckduckgo.com/search.html?width=200&site=YOURSITE" style="overflow:hidden;margin:0;padding:0;width:248px;height:38px;" frameborder="0"></iframe>