Vue Js gists to save time starting a new project
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
I hereby claim:
- I am ralphking on github.
- I am ralphking (https://keybase.io/ralphking) on keybase.
- I have a public key ASD1pCpcvfNvryMiYP_ov_6b3kZKR-D_V-yKhlIJS4waago
To claim this, I am signing this object:
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 SearchView(FormMixin, ListView): | |
template_name = 'search.html' | |
context_object_name = 'spaces' | |
form_class = SearchForm | |
def get_initial(self): | |
'''get initial values from request params''' | |
if self.request.GET: | |
initial = self.request.GET.dict() | |
return initial |
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
@login_required() | |
@permission_required('venue.add_space', raise_exception=True) | |
def new_space(request, venue_id): | |
venue = Venue.objects.get(id = venue_id) | |
if not venue.owner == request.user: | |
return HttpResponseForbidden() | |
else: | |
context = {'form': SpaceForm, 'venue': venue} | |
if request.method == 'POST': |
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
// set your board size | |
var size = "64"; | |
// initialize empty string | |
var string = ""; | |
// loop the sucker | |
for (var i = 0; i < size; i++) { | |
for (var j = 0; j < size; j++) { | |
if ((i + j) % 2 == 0) { | |
string += " "; | |
} else { |
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
// Use wp-config-local.php for local server settings, don't check that file onto the server | |
if ( file_exists( dirname( __FILE__ ) . '/wp-config-local.php' ) ) { | |
include( dirname( __FILE__ ) . '/wp-config-local.php' ); | |
// Otherwise use the below settings (on live server) | |
} else { | |
// Live Server Database Settings | |
define( 'DB_NAME', 'db_name'); | |
define( 'DB_USER', 'db_username'); |