Skip to content

Instantly share code, notes, and snippets.

View temperatio's full-sized avatar
:octocat:

César temperatio

:octocat:
View GitHub Profile
@temperatio
temperatio / annotated.js
Created May 17, 2011 21:59 — forked from madrobby/README.md
Luhn10 algorithm
function(
a, // credit card number (as string)
b, // placeholder
c, // placeholder
d, // placeholder
e // placeholder
){
b = a.length - 1, // index to check digit (last digit in number)
e = 0, // index to current digit from right
d = ~~a[b]; // value of check digit (~~ converts into a number, similiar to parseInt())
@temperatio
temperatio / app.js
Created January 13, 2012 23:54
Audio Test with Lungo.JS
var App = (function(lng, undefined) {
//Define your LungoJS Application Instance
lng.App.init({
name: 'Audio Test',
version: '0.1'
});
return {
@temperatio
temperatio / index.html
Created January 16, 2012 17:38
Simple audio javascript play with QuoJS
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>templates</title>
<script src="lib/QuoJS.js"></script>
<script>
$$(document).ready(function() {
<?php
/**
* post-process.php
* make sure to include post-process.php in your functions.php. Use this in functions.php:
*
* get_template_part('post-process');
*
*/
function do_insert() {
if( 'POST' == $_SERVER['REQUEST_METHOD']
@temperatio
temperatio / functions.php
Created March 11, 2014 18:27
Woocommerce: Products per page
/**
* Products per page
*/
add_filter( 'loop_shop_per_page', create_function( '$cols', 'return 24;' ), 20 );
@temperatio
temperatio / functions.php
Created March 11, 2014 18:29
Woocommerce: Remove count and ordering form shop archive pages
/**
* Remove count and ordering form shop archive pages
*/
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
@temperatio
temperatio / functions.php
Created March 11, 2014 18:31
Woocommerce: Remove related products
/**
* Remove related products
*/
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
#
# Original version by Grant Parnell is offline (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/)
# Update July 2014: no longer offline, see https://digitaldj.net/blog/2011/11/17/trim-enabler-for-os-x-lion-mountain-lion-mavericks/
#
# Looks for "Apple" string in HD kext, changes it to a wildcard match for anything
#
# Alternative to http://www.groths.org/trim-enabler-3-0-released/
# Method behind this madness described: http://forums.macrumors.com/showthread.php?t=1409151&page=4
# See discussion in comments here: https://www.macupdate.com/app/mac/39654/lion-tweaks
# And here: http://forums.macrumors.com/showthread.php?t=1410459
@temperatio
temperatio / dbbackup.sh
Last active March 16, 2018 08:45
Mysql backup and upload to remote server
#!/bin/sh
# Create a db dump and upload it to another server
#
BACK_SERVER='xxx.xxx.xxx.xxx'
BACK_SERVER_PORT='22'
BACK_SERVER_USER='user'
# Database credentials
DB_NAME='database'
@temperatio
temperatio / filebackup.sh
Created March 16, 2018 08:44
Backup a given path and upload to remote server
#!/bin/sh
# Create a db dump and upload it to another server
#
BACK_SERVER='xxx.xxx.xxx.xxx'
BACK_SERVER_PORT='22'
BACK_SERVER_USER='user'
# store current date