This file contains hidden or 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
from .layout import FormHelper, FormHelperMixin | |
class MyForm(FormHelperMixin, forms.ModelForm): | |
class FormHelperMeta: | |
# works like Meta, we just use to store property overrides | |
# doesn't need to inherit | |
# helper_class = MyCustomHelper | |
submit_text = "Submit!" | |
action = reverse('account:login') |
This file contains hidden or 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
from django import forms | |
from django.contrib.localflavor.gb.forms import GBPostcodeField | |
from crispy_forms.helper import FormHelper | |
from crispy_forms.layout import Layout, Fieldset, Submit | |
from crispy_forms.bootstrap import FormActions | |
from .models import Signup |
This file contains hidden or 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
input:not(.urlbar-input):not(.textbox-input):not(.form-control):not([type='checkbox']) { | |
-moz-appearance: none !important; | |
background-color: inherit; | |
color: inherit; | |
} | |
#downloads-indicator-counter { | |
color: white; | |
} |
This file contains hidden or 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
""" | |
Breadth-first search maze runner | |
maze_runner.py path-to-maze-file | |
Make sure your map has an entrance and exit on left & right side | |
respectively. | |
EXAMPLE: | |
########### |
This file contains hidden or 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
""" | |
https://en.wikipedia.org/wiki/Breadth-first_search | |
""" | |
import queue | |
def bfs(graph, root): | |
q = queue.Queue() |
This file contains hidden or 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
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul); | |
/* | |
* Copyright Simon Lydell 2015, 2016. | |
* | |
* This file is part of VimFx. | |
* | |
* VimFx is free software: you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation, either version 3 of the License, or | |
* (at your option) any later version. |
This file contains hidden or 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
<!DOCTYPE HTML> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<script src="https://code.jquery.com/jquery-2.2.2.min.js"></script> | |
</head> | |
<body> |
This file contains hidden or 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
defmodule Fizzbuzz do | |
def run do | |
Enum.each(1..100, fn(num) -> IO.puts(get_message(num)) end) | |
end | |
def get_message(num) do | |
cond do | |
rem(num, 15) == 0 -> "fizzbuzz" | |
rem(num, 5) == 0 -> "buzz" |
This file contains hidden or 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
hi Normal background: #e9e9e9; color:#215d9c; | |
hi CmdLine background: #e9e9e9; color:#215d9c; | |
hi CompGroup background: #e9e9e9; color:#215d9c; | |
hi CompTitle background: #dedede; font-weight: bold; | |
hi CompTitle>* color: #2e3436; padding: 1px 0.5ex; border-bottom: 2px solid #215d9c;border-top: 0.5px solid #d8d8d8; | |
hi CompItem background:#e9e9e9; color:#215d9c; | |
hi CompItem[selected] color: #ededed; background: #777; | |
hi CompDesc width: 500px; max-width: 500px; color: #465457; | |
hi CompDesc[selected] width: 500px; max-width: 500px; color: #ededed; | |
hi CompMsg margin-left: 16px; color: #215d9c; |
This file contains hidden or 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
package main | |
import ( | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) | |
func main() { |