Skip to content

Instantly share code, notes, and snippets.

var vibrate = function() {
var shake= 3;
$(".actionsMode[mode='on']").stop(true, false)
.css({
position: 'relative',
left: Math.round(Math.random() * shake) - ((shake + 1) / 2) + 'px',
top: Math.round(Math.random() * shake) - ((shake + 1) / 2) + 'px'
});
Buscar todas las lineas que contengan 'campaigns/' y 'info'
````bash
grep -e "campaigns/" *.log | grep -e "info"
````
Contar todas las líneas que contengan 'campaigns/' y 'info'
````bash
grep -e "campaigns/" *.log | grep -e "info" | wc -l
````
// disk free (-h human-readabke)
df -h
// disk usage
du -h --max-depth=1
@sangar82
sangar82 / Ibeacon App Android
Last active January 8, 2016 14:05
Ibeacon App Android
Ibeacon App Android
https://github.com/mikaelkindborg/evo-demos/tree/master/Demos2015/cordova-ibeacon
Un plugin no funcionaba (creo que era el de notificaciones) Aqui te enseñan a borrarlos
http://stackoverflow.com/a/30249591/1171049
//iOS app to simulate ibeacon
https://itunes.apple.com/us/app/cliqtags-beacon-advertiser/id1043842313
// Android: Installing Cordova and SDKs on OS X
@sangar82
sangar82 / gist:adea0a4669d034cdca6c
Last active December 29, 2015 14:51
Transforme table to graph
// Guardamos en un array los valores
var values = [];
var headers = [];
// get our values (get rows)
$('.datatables5 tbody tr').each(function(i, v){
values[i] = [];
//miramos cuantas columnas tiene para quitar la última de total
@sangar82
sangar82 / apt_history
Created May 26, 2015 10:35
apt history
tail -300 /var/log/apt/history.log
#add script to .oh-my-zsh/lib/functions.zsh
function rm () {
local path
for path in "$@"; do
# ignore any arguments
if [[ "$path" = -* ]]; then :
else
local dst=${path##*/}
# append the time if necessary
@sangar82
sangar82 / gist:d944d39d249a83c00e5a
Created May 7, 2015 09:03
Gist uppercase companies
BEGIN;
UPDATE
companies
SET
name = UPPER(name);
UPDATE
companies
SET
fiscal_name = UPPER(fiscal_name);
@sangar82
sangar82 / gist:e83e255da149882582b8
Last active April 24, 2024 08:10
Redis laravel example
Route::get('redis', array('as' => 'cache', 'do' => function()
{
$redis = Redis::connection();
//STRING
$redis->set('name', 'Taylor');
$name = $redis->get('name');
// LIST
// A list is a series of ordered values. Some of the important commands for interacting with lists are RPUSH, LPUSH, LLEN, LRANGE, LPOP, and RPOP.
@sangar82
sangar82 / gist:9eb5feca23e6bbd403d6
Last active August 29, 2015 14:09
Row search stats
<div class="row">
<div class="col-md-8">&nbsp;</div>
<div class="col-md-4">
<div class="form-inline" role="form" style="margin-bottom: 6px">
<div class="form-group" >
<input id="date_fix" name="dates_dateselectradio" type="radio" value="fix" checked="checked"> &nbsp;&nbsp;&nbsp;
</div>
<div class="form-group">