Skip to content

Instantly share code, notes, and snippets.

deby db0company

Block or report user

Report or block db0company

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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)

@db0company
db0company / generate_magicircles_translations.py
Created Sep 29, 2016
Generate a file that combines all the MagiCircles project in one file to import in POEditor
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
@db0company
db0company / MagiCirclesExamples.js
Created Aug 1, 2016
Examples to illustrate the MagiCircles Documentation
View MagiCirclesExamples.js
function updateCards() {
$('.card').unbind('click');
$('.card').click(function(e) {
e.preventDefault();
alert('Yay~');
return false;
});
reloadDisqus();
}
@db0company
db0company / MagiCirclesExamples.py
Last active May 27, 2017
Examples to illustrate the MagiCircles Documentation
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
View gist:60848ac343aa096db815814315847bb7
Internal Server Error: /editteam/8512/
Traceback (most recent call last):
File "/home/ubuntu/SchoolIdolAPI/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 111, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "./web/views.py", line 732, in editteam
'ownedcard': findOwnedCard(form.cleaned_data['card' + str(i)], account.deck),
File "/home/ubuntu/SchoolIdolAPI/env/local/lib/python2.7/site-packages/django/db/models/manager.py", line 92, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/ubuntu/SchoolIdolAPI/env/local/lib/python2.7/site-packages/django/db/models/query.py", line 446, in update_or_create
obj.save(using=self.db)
View gist:d0d3b4b2d01b86b356914bfa0aee5ffc
How it would work
People will still use facebook to organize trades: the only difference is that to verify the accounts and have middlemen, they need to follow this procedure:
- People have to create their account on School Idol Tomodachi and add their cards (at least URs + SRs)
- When they click on "Give away your account" or "Trade your account", they get a form:
- They have to upload a screenshot of their transfer code or write down their transfer code
- They can select whether they want to organize the giveaway on School Idol Tomodachi or somewhere else
View gist:1a61c8eaf642b206653459650bd6bd6b
{
'max_stats':{
'Smile':5380,
'Pure':5340,
'Cool':5350
},
'total_cards':857,
'years':[
u'Second',
u'First',
@db0company
db0company / remove_spaces
Created Apr 28, 2016
Replace spaces in all files in a folder with underscores
View remove_spaces
for f in *\ *; do mv "$f" "${f// /_}"; done
You can’t perform that action at this time.