This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="row"> | |
<div class="col-4"><p>col-4</p></div> | |
<div class="col-4"><p>col-4</p></div> | |
<div class="col-4"> | |
<div class="row"> | |
<div class="col-4"><p>A</p></div> | |
<div class="col-4"><p>B</p></div> | |
<div class="col-4"><p>C</p></div> | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* xRandom | |
* Returns an array of random numbers without repetition | |
* array range, int limit | |
*/ | |
function xRandom( range, limit ) { | |
if( --limit >= range[1] || limit < 0 ) return; | |
return (function _xr( i, r, result ) { | |
var max = range[1], min = range[0], j = r.length, c=0, | |
rand = Math.floor(Math.random() * (max - min + 1) + min); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function render( tplName, data ) { | |
try { | |
var tpl = $( '#' + tplName )[0].innerHTML || {}, | |
k, rx = /{\|\|.*?\|\|}/g, tmp ; | |
for( k in data ) { | |
tmp = new RegExp( '{\\|\\|data\\.'+ k +'\\|\\|}', 'g' ); | |
tpl = tpl.replace( tmp, data[ k ] ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dep: jQuery | |
//armazena state | |
var __old = history.state; | |
// checa state | |
setInterval( function() { | |
if( history.state !== __old ) { | |
//triga o evento | |
$( window ).trigger( 'meuevento', [1,3,2] ); | |
// cacheia state atual |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ./convertvideo.sh Directory filetype | |
# | |
# Ex: | |
# ./convertvideo.sh /videos mp4 | |
ls *$1 \ | |
| while read f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ./renamefiles.sh directory | |
# | |
ls *$1 | egrep 'regex here+' \ | |
| while read f | |
do | |
# if you need remove some character | |
tna=$(echo $f | sed 's/regex here//') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir /home/mount | |
sudo sshfs -o allow_other root@myipaddress:/ /home/mount -p 21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Single file (-P = ssh port) | |
sudo scp -P 21 root@server:/var/log/nginx/access.log /home/Downloads/ | |
# Recursive | |
sudo scp -r -P 21 root@server:/var/log/nginx/ /home/Downloads/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir fromftp | |
sudo curlftpfs -o allow_other ftp://user:pass@hostname /home/fromftp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Object construcion exemple | |
function MyClass() { | |
this.myProperty = 'foo'; | |
} | |
// Whitout new | |
var myInstance = {}; | |
MyClass.call( myInstance ); | |
console.log( 'without ' + myInstance.myProperty ); |
OlderNewer