Skip to content

Instantly share code, notes, and snippets.

View ivanrosolen's full-sized avatar
:octocat:
....

Ivan Rosolen ivanrosolen

:octocat:
....
View GitHub Profile
@ivanrosolen
ivanrosolen / Strings de Teste
Last active December 30, 2015 07:39
Criar um jeito em php para retornar apenas o nome do arquivo (sem extensão nem diretórios)
/var/www/public/upload/image.jpeg
imagem.01.png
/ivan.pdf
/var/www/public/upload/imaginação.JPG
/var/www/nome bem legal.png
ilári iê.gif
/opa_ivan.01_03.jpeg
swp.ivan.01.12.2013.php
/var/www/_windows Like.gif
yudi.jPeG
@ivanrosolen
ivanrosolen / gist:9122993
Created February 20, 2014 20:54
cURL commands
curl_setopt($ch, CURLOPT_COOKIE, ...); // -b
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // -X
curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE); // --data-binary
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: image/png']); // -H
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0); // -0
/* iPhone < 5 */
@media screen and (device-aspect-ratio: 2/3) {
.content{
max-height: 320px;
}
}
/* iPhone 5 */
@media screen and (device-aspect-ratio: 40/71) {}
Verifying that +ivanrosolen is my Bitcoin username. You can send me #bitcoin here: https://onename.io/ivanrosolen
### Keybase proof
I hereby claim:
* I am ivanrosolen on github.
* I am ivanrosolen (https://keybase.io/ivanrosolen) on keybase.
* I have a public key whose fingerprint is 8699 9CA1 11DE DE76 B51D 6792 43C1 E7C8 A6A5 4644
To claim this, I am signing this object:
@ivanrosolen
ivanrosolen / gist:4e4b70bd00069d7572c9
Created March 24, 2015 13:38
EC2 Ubuntu timezone
echo "America/Sao_Paulo" | sudo tee /etc/timezone
sudo dpkg-reconfigure --frontend noninteractive tzdata
#!/bin/bash
for file in $(find . -name '*.JPG')
do
echo "$file"
WIDTH=`sips -g pixelWidth $file | tail -n1 | cut -d' ' -f4`
if [ "$WIDTH" -lt "500" ]; then
mv $file ./nope/
#!/bin/bash
touch csv_ninja.csv
find -E . -regex '.*\.(psd|gif|png|jpeg)' | while read file; do
xmp=$(exiftool -xmp -b "${file}" | egrep 'xwnv:(.+)=(.+)"$' | cut -d : -f 2- | tr "\n" ";")
filename=$(basename "${file}")
@ivanrosolen
ivanrosolen / smtp gmail
Created October 13, 2015 10:54
Enable send email using smtp.gmail.com
trun on logging for less secure apps
https://www.google.com/settings/u/1/security/lesssecureapps
click continue
https://accounts.google.com/b/0/DisplayUnlockCaptcha
check here is there any logging to your account and enable
https://security.google.com/settings/security/activity?hl=en&pli=1
@ivanrosolen
ivanrosolen / ellipsis tooltip
Last active October 14, 2015 21:53
ellipsis tooltip
<html>
<body>
<style type="text/css">
.ivan {
text-overflow: ellipsis;
width: 200px;
white-space: nowrap;
overflow: hidden;
}
.tooltip {