Skip to content

Instantly share code, notes, and snippets.

.table-container th.asc:after {
content: '\0000a0\0025b2';
}
.table-container th.desc:after {
content: '\0000a0\0025bc';
}
.pagination {
text-align: center;
}
@jmorahan
jmorahan / .htaccess
Last active August 4, 2018 19:47
HSTS with Apache
<IfModule mod_headers.c>
# Remove any previously set header from the 'onsuccess' table.
Header unset Strict-Transport-Security
# Set the header in the 'always' table for HTTPS requests, replacing any previous header.
Header always set Strict-Transport-Security "max-age=31536000; includeSubdomains" env=HTTPS
# For HTTP requests, the header should not be sent.
Header always unset Strict-Transport-Security env=!HTTPS
</IfModule>
@vitorbritto
vitorbritto / rm_mysql.md
Last active February 28, 2025 09:58
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
    
from itertools import chain
from operator import attrgetter
# ascending oreder
result_list = sorted(
chain(queryset1, queryset2),
key=attrgetter('date_created'))
# descending order
from itertools import chain
result_list = list(chain(queryset1, queryset2))
@donatasnicequestion
donatasnicequestion / ADFBeanValidator.java
Created June 7, 2014 20:55
ADF Bean Validator for JSF303 integration with Oracle ADF
package com.nicequestion.donatas.adf.validate;
import javax.el.ValueExpression;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.BeanValidator;
import javax.faces.validator.FacesValidator;
import javax.faces.validator.ValidatorException;
@electronut
electronut / ldr.py
Created May 4, 2014 06:14
Display analog data from Arduino using Python (matplotlib animation)
"""
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import sys, serial, argparse
@ckinsey
ckinsey / decorators.py
Created March 22, 2014 16:34
Require SSL for Django views via a decorator. You'll need some setup in your web server to support the request.is_secure() method--see the Django docs.
from functools import wraps
from django.conf import settings
from django.http import HttpResponseRedirect
def require_ssl(view):
"""
Decorator that requires an SSL connection. If the current connection is not SSL, we redirect to the SSL version of
the page.
@hectoregm
hectoregm / angularfire-crud-es.md
Last active October 3, 2020 19:05
Tutorial for basic CRUD using AngularJS and Firebase

Tutorial para AngularFire (AngularJS + Firebase)

Introduccion

En este tutorial haremos uso de AnguarJS y de Firebase (esta combinacion es tambien llamada AngularFire) para implementar un CRUD basico para el ingreso de usuarios. En este tutorial se tiene como requisitos tener instalado git y tener una cuenta en Firebase

AngularJS

Es un framework MVC que esta implementado en Javascript este vive en el lado del cliente (navegador) y dado que usaremos como backend a Firebase que nos da un BD desde el cliente es solo necesario un servidor web para poder enviar HTML, CSS y el Javascript de la aplicacion. Haremos uso de un servidor web usando Node.js desde la consola para ver como va nuestra aplicacion.

#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten