Skip to content

Instantly share code, notes, and snippets.

View apelliciari's full-sized avatar

Alessandro Pelliciari apelliciari

View GitHub Profile
SyntaxError: unterminated string literal
editbox: '<div id="gdl-edit-box">\
edit-b...ver=1.0 (line 37)
SyntaxError: unterminated string literal
ed.selection.setContent('[accordion]<br/> \
@apelliciari
apelliciari / gist:5477587
Created April 28, 2013 17:22
my.cnf local
# Example MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# MySQL programs look for option files in a set of
# locations which depend on the deployment platform.
# You can copy this option file to one of those
# locations. For information about these locations, see:
@apelliciari
apelliciari / gist:5639266
Created May 23, 2013 20:39
500 errors after wsgi touch
[Thu May 23 22:37:29 2013] [info] mod_wsgi (pid=10061): Shutdown requested 'foo.com.djangoserver'.
[Thu May 23 22:37:29 2013] [info] [client 79.56.39.43] mod_wsgi (pid=9487): Connect after WSGI daemon process restart, attempt #1.
[Thu May 23 22:37:29 2013] [info] mod_wsgi (pid=10060): Shutdown requested 'foo.com.djangoserver'.
[Thu May 23 22:37:29 2013] [info] mod_wsgi (pid=10061): Stopping process 'foo.com.djangoserver'.
[Thu May 23 22:37:29 2013] [info] mod_wsgi (pid=10061): Destroying interpreters.
[Thu May 23 22:37:29 2013] [info] mod_wsgi (pid=10061): Destroy interpreter 'foo.com|'.
[Thu May 23 22:37:29 2013] [info] [client 79.56.39.43] mod_wsgi (pid=9487): Connect after WSGI daemon process restart, attempt #2.
[Thu May 23 22:37:29 2013] [info] mod_wsgi (pid=10059): Shutdown requested 'foo.com.djangoserver'.
[Thu May 23 22:37:29 2013] [info] mod_wsgi (pid=10060): Stopping process 'foo.com.djangoserver'.
[Thu May 23 22:37:29 2013] [info] mod_wsgi (pid=10060): Destroying interpreters.
@apelliciari
apelliciari / gist:5652725
Created May 26, 2013 13:04
logging conf + sentry
.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
@apelliciari
apelliciari / gist:5661901
Last active December 17, 2015 19:39
command exceptions
# -*- coding: utf-8 -*-
import os
import logging
from django.core.management.base import BaseCommand, CommandError
from django.conf import settings
logger = logging.getLogger(__name__)
class Command(BaseCommand):
help = "test unicode and logging"
@apelliciari
apelliciari / gist:5676266
Created May 30, 2013 07:30
named-checkzone + named-checkconf -z
root@vm1613:~# named-checkzone foo.com /var/lib/bind/foo.com.hosts
zone foo.com/IN: loaded serial 1369844282
OK
root@vm1613:~# named-checkconf -z
zone foo.com/IN: loaded serial 1369844282
zone localhost/IN: loaded serial 4
zone 127.in-addr.arpa/IN: loaded serial 1
zone 0.in-addr.arpa/IN: loaded serial 6
zone 255.in-addr.arpa/IN: loaded serial 1
----------------------------------------------------------------------------------------------
Tracking Code: Standard (Synchronous)
----------------------------------------------------------------------------------------------
<!-- Adform Tracking Code BEGIN -->
<script type="text/javascript" src="https://track.adform.net/serving/scripts/trackpoint/"></script>
<script type="text/javascript">
adf.Params.PageName = encodeURIComponent('WebsiteName|SectionName|SubSection|PageName');
adf.Params.Divider = encodeURIComponent('|');
adf.createOrder({
----------------------------------------------------------------------------------------------
Tracking Code: Standard (Asynchronous)
----------------------------------------------------------------------------------------------
<!-- Adform Tracking Code BEGIN -->
<script type="text/javascript">
var _adftrack = {
pm: 315326,
divider: encodeURIComponent('|'),
pagename: encodeURIComponent('WebsiteName|SectionName|SubSection|PageName'),
adf.Params.PageName = encodeURIComponent('InfinityTV|desktop|checkout|step1 scelta piano');
adf.Params.Divider = encodeURIComponent('|');
adf.track(315326);
@apelliciari
apelliciari / verifca.js
Created October 11, 2018 10:21
Verifica dominio www.boscolo.com share this
<script type='text/javascript' src='//platform-api.sharethis.com/js/sharethis.js#property=5bb4bcab7283210011cb5efa&product=inline-share-buttons' async='async'></script>