This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- array input --> | |
<?php | |
$max = isset($field['max']) && (int) $field['max'] > 0 ? $field['max'] : -1; | |
$min = isset($field['min']) && (int) $field['min'] > 0 ? $field['min'] : -1; | |
$item_name = strtolower(isset($field['entity_singular']) && !empty($field['entity_singular']) ? $field['entity_singular'] : $field['label']); | |
$items = old($field['name']) ? (old($field['name'])) : (isset($field['value']) ? ($field['value']) : (isset($field['default']) ? ($field['default']) : '' )); | |
// make sure not matter the attribute casting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# curl --header "X-GitHub-OTP: <code>" -u "<username>" https://api.github.com/repos/StriatumVentures/ZUPR/issues\?milestone\=1\&state\=open > issues.json | |
import json | |
with open("issues.json") as of: | |
data = json.load(of) | |
for issue in data: | |
t = issue['title'] | |
n = issue['number'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fish git prompt | |
set __fish_git_prompt_showdirtystate 'yes' | |
set __fish_git_prompt_showstashstate 'yes' | |
set __fish_git_prompt_showupstream 'yes' | |
set __fish_git_prompt_color_branch yellow | |
set __fish_git_prompt_showuntrackedfiles 'yes' | |
# Status Chars | |
set __fish_git_prompt_char_dirtystate '⚡' | |
set __fish_git_prompt_char_stagedstate '→' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RelatedField(object): | |
def __init__(self, *args, **kwargs): | |
sup = super(RelatedField, self) | |
if hasattr(sup, 'test'): | |
sup.test() | |
class Field(object): | |
def test(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Index: django/contrib/formtools/wizard/views.py | |
=================================================================== | |
--- django/contrib/formtools/wizard/views.py (revision 16341) | |
+++ django/contrib/formtools/wizard/views.py (working copy) | |
@@ -96,6 +96,7 @@ | |
instance_dict = None | |
condition_dict = None | |
template_name = 'formtools/wizard/wizard_form.html' | |
+ extra_context = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% extends 'admin/change_form.html' %} | |
{% load i18n %} | |
{% block content %} | |
<div id="content-main"> | |
<p>Step {{ wizard.steps.current }} of {{ wizard.steps.count }}</p> | |
<form action="." method="post">{% csrf_token %} | |
<table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% thumbnail candidate.picture "60x40" as im %} | |
<img class="quickProfilePicture" alt="{{ candidate.full_name }}" src="{{ im.url }}" style="margin:{{ im|margin:"60x40" }}" width="{{ im.x }}" height="{{ im.y }}" /> | |
{% empty %} | |
{% thumbnail "defaults/pol-dummy.jpg" "60x40" as im %} | |
<img class="quickProfilePicture" alt="{{ candidate.full_name }}" src="{{ im.url }}" style="margin:{{ im|margin:"60x40" }}" width="{{ im.x }}" height="{{ im.y }}" /> | |
{% endthumbnail %} | |
{% endthumbnail %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
====================================================== | |
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10 | |
====================================================== | |
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu | |
8.10. The article is targeted at a production environment, but keep in mind | |
this is a more generalized environment. You may have different requirements, | |
but this article should at least provide the stepping stones. | |
The article will use distribution packages where nesscary. As of 8.10 the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---- Minecraft Crash Report ---- | |
// Why did you do that? | |
Time: 11/18/14 5:50 PM | |
Description: Ticking block entity | |
java.lang.NullPointerException: Ticking block entity | |
at crazypants.enderio.machine.light.TileElectricLight.findNearestCharger(TileElectricLight.java:167) | |
at crazypants.enderio.machine.light.TileElectricLight.func_145845_h(TileElectricLight.java:151) | |
at net.minecraft.world.World.func_72939_s(World.java:1939) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pytest | |
from flaskbb.user.models import User | |
from flaskbb.forum.models import Forum, Category | |
@pytest.fixture | |
def category(database): | |
category = Category(title="Test Category") | |
category.save() |
NewerOlder