Skip to content

Instantly share code, notes, and snippets.

@yarko
yarko / problem8.py
Created October 3, 2013 05:09
grab a 1000 digit number from a web page
from lxml import html
node = html.parse('http://projecteuler.net/problem=8').getroot()
number_parts = node.cssselect('div.problem_content > p')[1].text_content().split()
print "".join(number_parts)
@yarko
yarko / emotion-update.dot
Last active December 25, 2015 15:39
A graphviz representation of the update from Panskepp and Brem, "Archeology of Mind", which captures what data tells us now about affective brain systems.
/* Affective systems - then and now
*/
digraph g {
graph [nodesep="0.7", margin="0.6,0.15"];
rankdir = LR;
edge [dir="back"];
node [fontname="verdana", shape=record, style="filled", fillcolor=snow];
@yarko
yarko / gist:8161967
Created December 28, 2013 17:41
using wingIDE with flask
# snippet for debugging w/ wingIDE:
if __debug__:
from os import environ
if 'WINGDB_ACTIVE' in environ:
app.debug = False
@yarko
yarko / django-debug-toolbar.patch
Created January 17, 2014 13:32
edx/edx-platform patch file for upgrading from django-debug-toolbar 0.9x to > 1.0x
diff --git a/cms/envs/dev.py b/cms/envs/dev.py
index ff9e650..f06b386 100644
--- a/cms/envs/dev.py
+++ b/cms/envs/dev.py
@@ -165,7 +165,7 @@ DEBUG_TOOLBAR_PANELS = (
# Django=1.3.1/1.4 where requests to views get duplicated (your method gets
# hit twice). So you can uncomment when you need to diagnose performance
# problems, but you shouldn't leave it on.
- # 'debug_toolbar.panels.profiling.ProfilingDebugPanel',
+ # 'debug_toolbar.panels.profiling.ProfilingPanel',
@yarko
yarko / build_version.json
Created January 31, 2014 05:41
build_version.json - the simple version, for edx release devstack
{
GIT_ACCT: "yarko",
THEME_ACCT: "Stanford-Online",
OPEN_EDX: "edx",
edx_platform_repo: "https://{{ COMMON_GIT_MIRROR }}/{{ GIT_ACCT }}/edx-platform.git",
edx_platform_version: "yarko/fix-rake-env-assets",
edxapp_use_custom_theme: false,
edxapp_theme_source_repo: 'https://{{ COMMON_GIT_MIRROR }}/{{ THEME_ACCT }}/edx-theme.git',
edxapp_theme_version: 'master',
edxapp_theme_name: "stanford"
@yarko
yarko / README.md
Created January 31, 2014 06:16
edx vagrant provisioning for ansibl

Baseline Vagrant Development

To develop a product from Open edX, you will want to accomplish a couple of things:

  • select a stable starting point;
  • fork to your product directory;
  • package a starting point vagrant box to ease development;
  • add product specific theme(s);
  • add product specific environment;
  • triage against a known system;
@yarko
yarko / Screenshot
Created January 31, 2014 06:25
edx-configuration release-2014-01-30 bug
PLAY RECAP ********************************************************************
localhost : ok=195 changed=59 unreachable=0 failed=0
[default] Checking for host entries
(Vedxdev)Yarko-Tymciuraks-MacBook-Pro-2:devstack yak007$ vagrant ssh
Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic x86_64)
* Documentation: https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Fri Jan 31 04:29:30 2014 from 10.0.2.2
@yarko
yarko / build-version.yml
Last active August 29, 2015 13:56
edx devstack bug report - bringup error, theme feature off - https://github.com/edx/configuration/issues/744
---
## 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 / Vagrantfile
Created February 7, 2014 15:55
W.I.P. edx configuration/vagrant/release/devstack Vagrantfile
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
export PYTHONUNBUFFERED=1
source /edx/app/edx_ansible/venvs/edx_ansible/bin/activate
@yarko
yarko / assets.py.patch
Created February 13, 2014 22:47
patch for #2520, pavelib/assets.py
diff --git a/pavelib/assets.py b/pavelib/assets.py
index 3f1064e..a2022f2 100644
--- a/pavelib/assets.py
+++ b/pavelib/assets.py
@@ -7,33 +7,35 @@ from .utils.envs import Env
from .utils.cmd import cmd, django_cmd
-COFFEE_DIRS = ['lms', 'cms', 'common']
+COFFEE_DIRS = ['lms', 'cms', 'common'] # baseline paths;