-
Allison Kaptur
-
"just read the code" is bad advice
-
understanding a codebase is a specialized skill
-
you can practice and improve it
-
analogy to "How to Read a Paper"
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
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: foo | |
# Defalt-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Description: Writes TCP on port 8725 to a file | |
### END INIT INFO | |
source /etc/rc.d/init.d/functions |
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
local hostname="%{$fg_bold[black]%}%m" | |
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ %s)" | |
PROMPT='${hostname} ${ret_status}%{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" |
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
diff -Naur php-pecl-parsekit-1.3.0.orig/parsekit-1.3.0/parsekit.c php-pecl-parsekit-1.3.0/parsekit-1.3.0/parsekit.c | |
--- php-pecl-parsekit-1.3.0.orig/parsekit-1.3.0/parsekit.c 2014-08-16 21:55:32.000000000 +0400 | |
+++ php-pecl-parsekit-1.3.0/parsekit-1.3.0/parsekit.c 2014-08-18 12:50:05.377165855 +0400 | |
@@ -300,7 +300,7 @@ | |
} | |
add_assoc_long(return_value, "num_args", ops->num_args); | |
add_assoc_long(return_value, "required_num_args", ops->required_num_args); | |
- add_assoc_bool(return_value, "pass_rest_by_reference", ops->fn_flags & ZEND_ACC_PASS_REST_BY_REFERENCE); | |
+ add_assoc_bool(return_value, "pass_rest_by_reference", ops->fn_flags & ZEND_ACC_VARIADIC); | |
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 python | |
""" | |
Translate a CSV document with a header to a YAML document that is a list of maps. | |
Uses constant memory and keeps field names in the original order. | |
""" | |
import sys | |
import csv | |
import yaml # requires PyYAML |
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 python3 | |
""" | |
Generate a random X-COM mission name. | |
See http://xcom.wikia.com/wiki/Missions_%28XCOM:_Enemy_Unknown%29 | |
and http://kotaku.com/5916411/why-all-of-xcom-enemy-unknowns-missions-sound-like-1980s-heavy-metal-albums | |
""" | |
from random import choice | |
prefixes = [ |
This is a Packer template for building a Debian-based AMI suitable for developing and running Python 3.4-based services. It uses a Debian 8 prerelease image as the base.
To build the AMI:
- Install Packer.
- Make sure your Amazon credentials are in
~/.aws/credentials
. - If using an AWS region other than Oregon, change
region
andsource_ami
inpacker-template.json
. - Run
packer build packer-template.json
.
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
#!/bin/sh | |
pip list --outdated | cut -d ' ' -f 1 | xargs pip install -U |
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
--- a/parsekit-1.3.0/parsekit.c | |
+++ b/parsekit-1.3.0/parsekit.c | |
@@ -78,18 +78,18 @@ | |
#ifdef IS_CV | |
/* PHP >= 5.1 */ | |
} else if (node->op_type == IS_CV) { | |
- add_assoc_long(return_value, "var", node->u.var); | |
- add_assoc_stringl(return_value, "varname", op_array->vars[node->u.var].name, op_array->vars[node->u.var].name_len, 1); | |
+ add_assoc_long(return_value, "var", node->u.op.var); | |
+ add_assoc_stringl(return_value, "varname", op_array->vars[node->u.op.var].name, op_array->vars[node->u.op.var].name_len, 1); |
NewerOlder