View availability_calendar.py
# Original calendar thingy
@property
def availability_calendar(self):
calendar = [['', 'M', 'T', 'W', 'T', 'F', 'S', 'S']] + [
[self._I_TO_AVAILABILITY[i] if j == 0 else 'no' for j in range(8)]
for i in range(len(self.AVAILABILITY_CHOICES))
]
for a, v in self.availability.items():
if v:
View ranking.sh
cat votes.txt | sort | uniq -c | sort -r
View react.el
(add-to-list 'load-path "~/.emacs.d/installed/")
(when (fboundp 'electric-indent-mode) (electric-indent-mode -1))
(require 'web-mode)
(add-to-list 'auto-mode-alist '("\\.phtml\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.tpl\\.php\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.[agj]sp\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.as[cp]x\\'" . web-mode))
(add-to-list 'auto-mode-alist '("\\.erb\\'" . web-mode))
View twitter-images-rename.sh
for img in `ls *-large`; do newimg=`echo $img | rev | cut -d'-' -f2- | rev`; echo $newimg; mv $img $newimg; done
View skills_sentences.md

Perfect Lock

notes

For every N notes, there is a N% chance of turning all goods and greats in the next N seconds into perfects. (Level 1)

seconds

Every N seconds, there is a N% chance of turning all goods and greats in the next N seconds into perfects. (Level 1)

View generate_magicircles_translations.py
#!/bin/bash
cd ~/Documents/python/MagiCircles/ &&\
source env/bin/activate &&\
rm -f web/locale/ja/LC_MESSAGES/django.po &&\
python manage.py makemessages -l ja --ignore=env/* --ignore=./settings.py --ignore=sample_project/sample_project/settings.py --ignore=web/templates/password/* --ignore=web/django_translated.py &&\
deactivate &&\
cd ~/Documents/python/StardustRun/ &&\
source env/bin/activate &&\
rm -f stardustrun/locale/ja/LC_MESSAGES/django.po &&\
python manage.py makemessages -l ja --ignore=env/* --ignore=stardustrun_project/settings.py &&\
View tinypng.py
from __future__ import division
import tinify, cStringIO, os
from PIL import Image
from django.conf import settings as django_settings
from django.core.files.temp import NamedTemporaryFile
from django.core.files.images import ImageFile
def shrinkImageFromData(data, filename):
_, extension = os.path.splitext(filename)
extension = extension.lower()
View pattern.sh
#!/bin/bash
convert "$1" -flop tmp
convert "$1" tmp +append tmp
convert "$1" -flop tmp.png
convert "$1" tmp.png +append tmp.png
convert tmp.png -flip "$1"
convert tmp.png "$1" -append "$1"
rm tmp.png
View MagiCirclesExamples.js
function updateCards() {
$('.card').unbind('click');
$('.card').click(function(e) {
e.preventDefault();
alert('Yay~');
return false;
});
reloadDisqus();
}
View MagiCirclesExamples.py
def filterCards(queryset, parameters, request):
if 'promo_only' in parameters:
queryset = queryset.filter(is_promo=True) if 'promo_only'
return queryset
############################################################
def FilterCardsForm(MagiFilter):
class Meta:
model = models.Card