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
$.customMethod = function(){ | |
return $.ajax({ | |
url: '/targetUrl/', | |
// data: {param1: 'value1'}, | |
dataType: 'jsonp', | |
}).promise(); | |
}; | |
var outer = $.customMethod(); |
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
switch(n) | |
{ | |
case 1: | |
execute code block 1 | |
break; | |
case 2: | |
execute code block 2 | |
break; | |
default: | |
code to be executed if n is different from case 1 and 2 |
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
$.extend($.expr[':'], { | |
over100pixels: function(a) { | |
return $(a).height() > 100; | |
} | |
}); | |
$('.box:over100pixels').click(function() { | |
alert('Элемент, который вы потревожили своим кликом, в высоту более 100 пикселов'); | |
}); |
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
Show hidden characters
{ | |
"folders": | |
[ | |
{ | |
"path": "/home/wowkalucky/dev/asnportal_project/_asnportal/", | |
"folder_exclude_patterns": ["venv","run"] | |
} | |
] | |
} |
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
*.py~ | |
*.py[cod] | |
local_settings.py | |
*.db | |
*sublime* | |
wsgi.py |
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
DebuggingServer |
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
# forms.py ==================================================================== | |
from django import forms | |
class NAMEForm(forms.Form): | |
FIELDNAME1 = forms.CharField(required=True,) | |
FIELDNAME2 = forms.CharField( | |
widget=forms.Textarea(attrs={'class': 'input-second'}),) | |
# views.py ==================================================================== | |
from project.apps.APPNAME.forms import NAMEForm | |
from django.http import HttpResponseRedirect |
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
class SplitTextMultiWidget(forms.MultiWidget): | |
def __init__(self, attrs=None): | |
_widgets = ( | |
forms.TextInput(attrs={'class': 'input-second'}), | |
forms.TextInput(attrs={'class': 'input-second'}), | |
) | |
super(SplitTextMultiWidget, self).__init__(_widgets, attrs) | |
def decompress(self, values): |
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
#!/usr/bin/env bash | |
# file: ~/.virtualenvs/postmkvirtualenv | |
# This hook is run after a new virtualenv is activated. | |
# setup python interpretor and sitepackages | |
# for Sublime Text's SublimeCodeIntel plugin. | |
# codeintel looks in the root of any folder opened via `subl foldername` | |
# for foldername/.codeintel/config | |
# it also looks in ~/.codeintel/config |
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
def reverseString(aStr): | |
# base case: | |
if len(aStr) == 0: | |
return '' | |
# recursive case: | |
else: | |
return aStr[-1:] + reverseString(aStr[:-1]) |