Skip to content

Instantly share code, notes, and snippets.

SERVICES
https://www.rootbuzz.com/
http://bottlenose.com/products
http://cloudcmp.co/
http://gdriv.es/
http://www.shoeboxify.com/
https://www.makesets.com/
http://archive.is/
http://areyouahuman.com/
http://avatars.io/
define [
'jquery'
'underscore'
'backbone'
'lib/gui'
'models/notification'
'views/notification'
'vendor/tween'
'jquery-ui'
@cmpscabral
cmpscabral / newmysqluser
Last active February 14, 2017 18:00
create mysql user
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@‘localhost';
FLUSH PRIVILEGES;
ValueObject = function(value) {
this.value = value;
}
$.extend(ValueObject.prototype, {
get: function() {
return this.value;
}
});
@cmpscabral
cmpscabral / redirect
Created January 22, 2014 15:18 — forked from codepo8/redirect
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
# allowed domains, add as needed
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?christianheilmann.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?wait-till-i.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mozilla.org [NC]
# search engines and social sites and stuff
checkProvadoresEscolhidos : function() {
// se ainda não temos provadores escolhidos, posso alterar à vontade
if (sessoes_edit.dtgHorariosProvadoresEscolhidos == 0) {
return true;
}
// se não, tenho que confirmar se vou fazer asneiras
var txtDataInicio = $('#dtgHorariostxtDataInicio');
var txtDataFim = $('#dtgHorariostxtDataFim');
var txtHoraInicio = $('#dtgHorariostxtHoraInicio');
@cmpscabral
cmpscabral / gist:9879190
Created March 30, 2014 20:23
joomla component/module/plugin parameters
Plugin parameters from inside a plugin
$param = $this->params->get('paramName', 'defaultValue');
Plugin parameters from outside a plugin
$plugin = &JPluginHelper::getPlugin('exampleType', 'example');
$pluginParams = new JParameter($plugin->params);
$param = $pluginParams->get('paramName', 'defaultValue');
Module parameters from inside a module

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

function hostReachable() {
// Handle IE and more capable browsers
var xhr = new ( window.ActiveXObject || XMLHttpRequest )( "Microsoft.XMLHTTP" );
var status;
var server = window.location.hostname;
if (window.location.port != '') {
server += ':'+window.location.port;
}
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);