Skip to content

Instantly share code, notes, and snippets.

View ideiasfrescas's full-sized avatar

Ideias Frescas, design e multimédia ideiasfrescas

View GitHub Profile
@ideiasfrescas
ideiasfrescas / matchheight.js
Created January 12, 2021 16:03
matchheight caseiro
/* author @dactyllo */
var matchHeight = function(classe, perLine) {
var peeps = $(String(classe)+":visible").css('height','auto').get();
var line = isNaN(perLine) ? peeps.length : parseInt(perLine);
for(var i = 0;i<peeps.length;i=i+line) {
var height = 0;
for(var x = i;x<(i+line);x++) {
if(peeps[x] && peeps[x].clientHeight > height) height = peeps[x].clientHeight;
}
for(var x = i;x<(i+line);x++) {
@ideiasfrescas
ideiasfrescas / phpdoc2githubwiki
Created October 21, 2020 10:28
Correr phpdoc e fazer upload para a wiki
#!/bin/bash
if ! type "php" > /dev/null; then
echo "PHP not found!" 1>&2
echo "Please follow the install instructions at http://php.net/ then try again" 1>&2
exit
fi
if ! type "git" > /dev/null; then
echo "Git not found!" 1>&2
@ideiasfrescas
ideiasfrescas / index.php
Created September 9, 2020 13:00
Importar ficheiros gigantes de SQL
$lines = file('agrupama.sql'); //lê o ficheiro para dentro de um array
foreach ($lines as $line) {
// Skip it if it's a comment
if (substr($line, 0, 2) == '--' || $line == '')
continue;
// Add this line to the current segment
$templine .= $line;
// If it has a semicolon at the end, it's the end of the query
if (substr(trim($line), -1, 1) == ';') {
// Perform the query