Skip to content

Instantly share code, notes, and snippets.

View gravataLonga's full-sized avatar
🤓
Zig Nerding

Jonathan Fontes gravataLonga

🤓
Zig Nerding
View GitHub Profile
@gravataLonga
gravataLonga / convert.sh
Created May 15, 2018 10:42
Convert QL Video to MP4
#!/bin/bash
function file_extension {
local filename=$(basename "$1")
echo "${filename##*.}"
}
function basename_test {
echo $(basename "$1" .qt)
}
@gravataLonga
gravataLonga / FingerPrint
Last active June 11, 2018 16:11
Fingerprint or Digest files - SHELL
# Create first
find -type f -name "*.php" -exec md5sum "{}" + > checklist.chk
# Save on remote server or your computer, it best if your create a hook on git or mercurial to create this on the fly.
# Later on or in cron you must check if all is good.
# Can you even do remove write permission,
# chmod a-w checklist.chk
# This will give you the following pattern:
# file: OK
@gravataLonga
gravataLonga / snow.sh
Created December 27, 2017 14:19
Snow on Cli
#!/bin/bash
LINES=$(tput lines)
COLUMNS=$(tput cols)
declare -A snowflakes
declare -A lastflakes
clear
@gravataLonga
gravataLonga / apache-webp-rewrite.conf
Created December 20, 2017 12:46 — forked from seeekr/apache-webp-rewrite.conf
enabling apache to serve WebP image files if accepted by browser (and .webp files available)
# originally from https://groups.google.com/a/webmproject.org/group/webp-discuss/browse_thread/thread/196ac4ea705688d8
<IfModule mod_rewrite.c>
# TODO: don't forget to put
# AddType image/webp .webp
# in your mods-available/mime.conf
# (though this is optional because we're setting
# the mime type manually in the RewriteRule)
# Enable rewrite
@gravataLonga
gravataLonga / top.blade.php
Created December 9, 2017 18:48
Vertical Align tailwindcss
<div class="bg-white w-full py-4 shadow">
<div class="flex justify-between content-center container mx-auto px-4">
<div class="w-1/2">
<div class="flex">
<div class="mr-4">
<a href="{{ route('home') }}">
<img src="{{ asset('images/owler-01.png') }}" alt="Owler" class="w-8">
</a>
</div>
<div class="mt-2 font-sans">
@gravataLonga
gravataLonga / node-sass.txt
Created November 13, 2017 17:47
binding.readdir(pathModule._makeLong(path)) - /node_modules/node-sass/vendor
Caso der este erro:
fs.js:808
return binding.readdir(pathModule._makeLong(path));
^
Error: ENOENT: no such file or directory, scandir '/node_modules/node-sass/vendor'
Correr:
@gravataLonga
gravataLonga / run.sh
Created November 13, 2017 14:46
Convert mxf video file to mp4 file.
ffmpeg -i input.mxf -acodec copy -vcodec copy -y output.mov
ffmpeg -i output.mov -vcodec h264 -acodec aac -strict -2 output.mp4
@gravataLonga
gravataLonga / 0_reuse_code.js
Created June 5, 2017 09:49
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@gravataLonga
gravataLonga / aes.php
Last active May 30, 2018 07:02
AES Encrypt and Decrypt
<?php
/**
Aes encryption
*/
class AES {
const M_CBC = 'cbc';
const M_CFB = 'cfb';
const M_ECB = 'ecb';
const M_NOFB = 'nofb';
@gravataLonga
gravataLonga / pattern.php
Created May 5, 2016 20:27
Cache Manager, Cache Repository, Cache Factory
<?php
interface Factory
{
/**
* Get a cache store instance by name.
*
* @param string|null $name
* @return mixed
*/