Skip to content

Instantly share code, notes, and snippets.

@yarko
yarko / envs.py.patch
Created February 13, 2014 22:54
patch for #2520, pavelib/utils/envs.py
diff --git a/pavelib/utils/envs.py b/pavelib/utils/envs.py
index 798cb3c..e120ba8 100644
--- a/pavelib/utils/envs.py
+++ b/pavelib/utils/envs.py
@@ -4,6 +4,7 @@ Helper functions for loading environment settings.
import os
import sys
import json
+import re
from lazy import lazy
@yarko
yarko / Vagrantfile
Last active August 29, 2015 13:59
edx-platform#3094 test methods
VAGRANTFILE_API_VERSION = "2"
MEMORY = 2048
CPU_COUNT = 2
$script = <<SCRIPT
if [ ! -d /edx/app/edx_ansible ]; then
echo "Error: Base box is missing provisioning scripts." 1>&2
exit 1
fi
@yarko
yarko / build-version.yml
Last active April 9, 2020 15:51
edx injera theming test-kit
---
## build-version.yml
#
# Use with ansible bringup;
# - *_version specs can be branches, tags, or commits
# - you can comment out any items you do not want to override;
# they will retain their settings as in ansible playbooks
# for those items.
#
@yarko
yarko / console output.txt
Last active August 29, 2015 14:04
paper-in-dart example
# This from:
# Dart Editor version 1.6.0.dev_04_00 (DEV)
# Dart SDK version 1.6.0-dev.4.0
#
# Run on https://github.com/zoechi/so_question_24723315
# (modernizer-2.6.2 line commented out in index.html)
#
--- 1:25:04 PM Running pub upgrade on /Users/yak007/workspace/Angular/angular-dart/paper-in-dart-example ... ---
Resolving dependencies...
@yarko
yarko / droplinks.py
Last active August 29, 2015 14:07
Find & fix bad Symlinks in Dropbox folder
@yarko
yarko / Literacy-and-Formal-Proofs.md
Last active August 29, 2015 14:16
Timsort Fix, partially clarified

Recently, I saw proponents of automated tools show a bug found in the timsort hybrid sorting algorithm.

It's been widely used, and ported, so this is with some pride that proponents of a particular approach gloat, with cause.

http://envisage-project.eu/proving-android-java-and-python-sorting-algorithm-is-broken-and-how-to-fix-it/#sec3

But several things stand out. The solution is what SEI would have named "low maturity" (not quite - the article did go through it elsewhere):

  • it copy / paste's what was and what is, leaving it to the reader to discover what changes were made;

Keybase proof

I hereby claim:

  • I am yarko on github.
  • I am yarkot (https://keybase.io/yarkot) on keybase.
  • I have a public key whose fingerprint is F5AA 9AFA 0273 A0CF 8500 9845 8E77 6F94 BF39 12FA

To claim this, I am signing this object:

@yarko
yarko / python3-link.sh
Last active August 29, 2015 14:27
mac homebrew python3 devel install prioritization & link checks
@yarko
yarko / clear_list.py
Last active October 30, 2015 18:22
Clear List (python) - the confusion of slice-assignment vs. slice selection
def clear(alist):
'''clear(alist)
when you want the contents of a list cleared,
so that all references to that list are affected.
python3 has a clear() method on lists;
there are at least 3 other ways to accomplish the same,
two of them syntactically tricky, and obscure.
@yarko
yarko / plantuml_magics.py
Last active November 2, 2015 00:09 — forked from sberke/plantuml_magics.py
An Plantuml extension for generating UML figures from within ipython notebook.
"""
An Plantuml extension for generating UML figures from within ipython notebook.
Source: http://stackoverflow.com/questions/20303335/ipython-notebook-plantuml-extension
See example notebook at: http://nbviewer.ipython.org/gist/sberke/bb90ff09193a8888d7f7
"""
import os
from IPython.core.magic import magics_class, cell_magic, Magics
from IPython.display import Image, SVG