This file contains hidden or 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 re | |
pattern = re.compile(sys.argv[1]) | |
last = int(len(sys.argv)) - 1 | |
reverse = True if sys.argv[last] == '-v' else False | |
lines = sys.stdin.readlines() | |
for line in lines: | |
if bool(pattern.search(line)) != reverse: | |
sys.stdout.write(line) |
This file contains hidden or 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 argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-r', action='store_const', const=True, required=False) | |
args = parser.parse_args() | |
lines = sys.stdin.readlines() | |
lines.sort(reverse = args.r) | |
for line in lines: |
This file contains hidden or 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 argparse | |
import collections | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-c', action='store_const', const=True, required=False) | |
args = parser.parse_args() | |
lines = sys.stdin.readlines() | |
counter = collections.Counter(lines) |
This file contains hidden or 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 | |
last_line = None | |
for line in sys.stdin.readlines(): | |
if line != last_line: | |
sys.stdout.write(line) | |
last_line = line |
This file contains hidden or 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
/*------- Grid -------*/ | |
$total-columns: 8; // 8 columns | |
$column-width: 4.5em; // columns are 4.5em wide | |
$gutter-width: 2em; // with 2em gutters | |
$grid-padding: 1em; // and 1em padding on the grid container | |
$container-style: magic; | |
.wrapper__inner { | |
@include clearfix(); |
This file contains hidden or 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
# config.ru for Pow + Wordpress, based on http://stuff-things.net/2011/05/16/legacy-development-with-pow/ | |
# added hackery to work around wordpress issues - Patrick Anderson ([email protected]) | |
# clearly this could be cleaner, but it does work | |
require 'rack' | |
require 'rack-legacy' | |
require 'rack-rewrite' | |
# patch Php from rack-legacy to substitute the original request so | |
# WP's redirect_canonical doesn't do an infinite redirect of / |
This file contains hidden or 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
.highlight{background-color:#073642;color:#93a1a1}.highlight .c{color:#586e75 !important;font-style:italic !important}.highlight .cm{color:#586e75 !important;font-style:italic !important}.highlight .cp{color:#586e75 !important;font-style:italic !important}.highlight .c1{color:#586e75 !important;font-style:italic !important}.highlight .cs{color:#586e75 !important;font-weight:bold !important;font-style:italic !important}.highlight .err{color:#dc322f !important;background:none !important}.highlight .k{color:#cb4b16 !important}.highlight .o{color:#93a1a1 !important;font-weight:bold !important}.highlight .p{color:#93a1a1 !important}.highlight .ow{color:#2aa198 !important;font-weight:bold !important}.highlight .gd{color:#93a1a1 !important;background-color:#372c34 !important;display:inline-block}.highlight .gd .x{color:#93a1a1 !important;background-color:#4d2d33 !important;display:inline-block}.highlight .ge{color:#93a1a1 !important;font-style:italic !important}.highlight .gr{color:#aa0000}.highlight .gh{color:#586e |
This file contains hidden or 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
/** | |
* A simple theremin | |
* Developed by the random bit | |
* http://therandombit.wordpress.com/2011/11/21/light-controlled-ldr-theremin/ | |
* | |
*/ | |
int val = 0; | |
void setup() { |
This file contains hidden or 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
/** | |
* Flying a plane | |
*/ | |
#fly { | |
width: 300px; | |
background: #cacaca; | |
position: fixed; | |
right: -300px; | |
animation: fly 8s ease-in; |
This file contains hidden or 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
/** | |
* Sea waves | |
*/ | |
#sky { | |
width: 100%; | |
height: 600px; | |
position: fixed; } | |
#sea { |