sudo mysql -u root -p
SHOW databases;
+----------------------------+
| Database |
+----------------------------+
sudo swapoff -a
sudo dd if=/dev/zero of=/swapfile bs=1G count=8
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
from django.contrib import admin | |
from django.contrib.admin.models import LogEntry, DELETION | |
from django.utils.html import escape | |
from django.urls import reverse | |
from django.utils.safestring import mark_safe | |
@admin.register(LogEntry) | |
class LogEntryAdmin(admin.ModelAdmin): | |
date_hierarchy = 'action_time' |
You should have some tools installed like Homebrew, a text editor such as Sublime Text and it's subl command line app inside a bin
folder and some basic terminal knowledge.
This gist is a more detailed version of niepi's gist with things that worked for me. It may help someone :)
$ brew install php --with-apache --with-mysql --with-pgsql --with-intl
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
$.fn.CurrencyInput = function(options){ | |
var opts = $.extend({}, $.fn.CurrencyInput.defaults, options); | |
return this.each(function(){ | |
var el = $(this); | |
var form_group = el.parents(opts.parent_wrapper); | |
var message_wrapper = form_group.find(opts.message_notification); | |
var min = opts.min, max = opts.max; | |
var value_target = opts.value_target; |
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
// Time difference function | |
function timeDiff(start, end) { | |
//today, now! | |
//Get the diff | |
var diff = end - start; | |
//Create numbers for dividing to get hour, minute and second diff | |
var units = [ | |
1000 * 60 * 60 *24, | |
1000 * 60 * 60, | |
1000 * 60, |
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
#-*- coding: utf-8 -*- | |
import urlparse | |
from django.contrib.auth import REDIRECT_FIELD_NAME, login | |
from django.contrib.auth.forms import AuthenticationForm | |
from django.http import HttpResponseRedirect | |
from django.utils.decorators import method_decorator | |
from django.views.decorators.cache import never_cache | |
from django.views.decorators.csrf import csrf_protect | |
from django.views.generic.edit import FormView | |
from django.conf import settings |
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
<div id="container"> | |
<ul id="menu"> | |
<li><a href="#">About Me</a> | |
<ul> | |
<li><a href="#">Lorem ipsum dolor</a></li> | |
<li><a href="#">Maecenas lacinia sem</a></li> | |
<li><a href="#">Suspendisse fringilla</a></li> | |
</ul> | |
</li> | |
<li><a href="#">Portfolio</a> |
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
<div id="container"> | |
<ul id="menu"> | |
<li><a href="#">About Me</a> | |
<ul> | |
<li><a href="#">Lorem ipsum dolor</a></li> | |
<li><a href="#">Maecenas lacinia sem</a></li> | |
<li><a href="#">Suspendisse fringilla</a></li> | |
</ul> | |
</li> | |
<li><a href="#">Portfolio</a> |
NewerOlder