Skip to content

Instantly share code, notes, and snippets.

Avatar

Ben Warren bwarren2

  • Education Advisory Board
  • Washington, DC
View GitHub Profile
View foo.vue
<template>
<div id="app">
<img src="./assets/logo.png">
<h1>{{ msg }}</h1>
<h2>Essential Links</h2>
</template>
<script>
export default {
name: 'app',
View gist:aa97230762e6f6494fa5
#Linux tutorial for nathaniel
## Ubuntu Overall
* ubuntu button => open general search (like spotlight)
* ubuntu + f => spotlight for files
* ubuntu + a => spotlight for applications
* hold ubuntu button => keyboard shortcuts
* `alt + <first letter of top bar menu options` => open menu option
View gist:2cc4f17f41ec5697c0df
~/proj $ python manage.py showmigrations --plan
/app/.heroku/python/lib/python2.7/site-packages/kombu/utils/__init__.py:407: UserWarning: Module argparse was already imported from /app/.heroku/python/lib/python2.7/argparse.py, but /app/.heroku/python/lib/python2.7/site-packages is being added to sys.path
from pkg_resources import iter_entry_points
[X] players.0001_initial
[X] contenttypes.0001_initial
[X] auth.0001_initial
[ ] accounts.0001_initial
[X] accounts.0002_auto_20150420_1410
[X] admin.0001_initial
[ ] contenttypes.0002_remove_content_type_name
View gist:5ce91fa295520ea166df
~ $ python proj/manage.py migrate --fake-initial
/app/.heroku/python/lib/python2.7/site-packages/kombu/utils/__init__.py:407: UserWarning: Module argparse was already imported from /app/.heroku/python/lib/python2.7/argparse.pyc, but /app/.heroku/python/lib/python2.7/site-packages is being added to sys.path
from pkg_resources import iter_entry_points
Operations to perform:
Synchronize unmigrated apps: messages, mptt, rest_framework, tagging, health, bootstrapform, storages, corsheaders, staticfiles, pipeline, django_forms_bootstrap, utils, payments
Apply all migrations: <my apps>, sessions, sites, admin, auth, teams, contenttypes
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
View gist:ea59e47d9b51b14cf713
Synchronizing apps without migrations:
Creating tables...
Running deferred SQL...
Installing custom SQL...
Running migrations:
No migrations to apply.
Traceback (most recent call last):
File "proj/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python2.7/site-packages/django/core/management/__init__.py", line 338, in execute_from_command_line
View gist:c0b929490f5a4ff0e7b9
### Keybase proof
I hereby claim:
* I am bwarren2 on github.
* I am tenukiben (https://keybase.io/tenukiben) on keybase.
* I have a public key whose fingerprint is 3886 1DBA 8A9A BA47 AF0D D3EA 2CD8 D7E5 84DF 385E
To claim this, I am signing this object:
View gist:d9be188ebb93cdc06daf
ben@Watt:~$ python
Python 2.7.5+ (default, Feb 27 2014, 19:37:08)
[GCC 4.8.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> with open('foobar.txt', 'r') as f:
... data = f.read()
...
>>> data
'\n\n# I can totally write C, and just have elected not to here! (Not really.)\n'
>>> with open('foobar.txt', 'w') as f:
View gist:a1097ecc7106296afb7c
setwd("~/Downloads")
df.lily = read.csv('lily.csv')
summary(df.lily)
str(df.lily)
colnames(df.lily)
df.lily$cat = ''
df.lily[df.lily$Falling.Asleep.Time==0,]$cat='Put To Sleep'
df.lily[df.lily$Falling.Asleep.Time!=0,]$cat='Self To Sleep'
View gist:f0b296fff71b78c42488
#script.py
from heroes.mommy_recipes import make_hero
make_hero(steam_id=1)
# mommy_recipes.py
from model_mommy.recipe import Recipe, seq, foreign_key
from model_mommy import mommy
View gist:3da761cfb3c46387b6a1
(Pdb) match.entities
<smoke.model.collection.entities.Collection object at 0x7fc502b6dc58>
(Pdb) dir(match.entities)
['__class__', '__contains__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__len__', '__new__', '__pyx_vtable__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'by_cls', 'by_ehandle', 'by_index', 'delete', 'get', 'put']
(Pdb) for a, b in match.entities.by_ehandle.iteritems(): print a, b, b.cls, b.index, b.serial, b.pvs, b.state
2018920 <smoke.model.entity.Entity object at 0x390db48> 8 1640 985 1 <smoke.model.entity.State object at 0x390f1c0>
2057833 <smoke.model.entity.Entity object at 0x390dbd8> 8 1641 1004 1 <smoke.model.entity.State object at 0x390f1e8>
1287786 <smoke.model.entity.Entity object at 0x390dc68> 8 1642 628 1 <smoke.model.entity.State object at 0x390f210>