Skip to content

Instantly share code, notes, and snippets.

View vinicius-stutz's full-sized avatar
🐢
I may be slow to respond.

Vinícius Stutz vinicius-stutz

🐢
I may be slow to respond.
View GitHub Profile
@vinicius-stutz
vinicius-stutz / index.html
Last active March 5, 2024 12:31
File Upload with PHP
<html>
<head>
<title>PHP: File Upload</title>
</head>
<body>
<!-- The data encoding type, enctype, MUST be specified as below -->
<form enctype="multipart/form-data" action="upload.php" method="POST">
<!-- MAX_FILE_SIZE must precede the file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
<!-- Name of input element determines name in $_FILES array -->
@vinicius-stutz
vinicius-stutz / facebook_profile_pic.md
Last active October 24, 2015 22:48
Get a Facebook user's profile image

Get a Facebook user's profile image

This is an example using the img tag:

<img src="//graph.facebook.com/vinicius.stutz/picture?type=normal" class="img-circle" width="150" height="150" />

The sizes available are:

  1. Large size photo https://graph.facebook.com/{facebookId}/picture?type=large
  2. Medium size photo https://graph.facebook.com/{facebookId}/picture?type=normal
  3. Small size photo https://graph.facebook.com/{facebookId}/picture?type=small
  4. Square photo https://graph.facebook.com/{facebookId}/picture?type=square
@vinicius-stutz
vinicius-stutz / Feedly.md
Last active October 25, 2015 03:03
Using Chrome's RSS Extension with Feedly

Adding an item to Feedly directly from Chrome

  1. First, you have to install the RSS Subscription Extension
  2. After installing the plugin, go to the page of your extensions (Copy chrome://extensions/ and paste it into your Chrome address bar)
  3. Click Options
  4. Click the "Add" button
  5. In the description field write "Feedly" (without quotes)
  6. In the URL field type http://www.feedly.com/home#subscription/feed/%s
  7. After you click "OK" you can add a feed to Feedly directly from your browser

Source: coderwall

@vinicius-stutz
vinicius-stutz / ISO Country List (SQL Insert).md
Last active November 8, 2015 03:32
ISO Country List (SQL Insert)

SQL: ISO Country List

SQL Insert in English and Portuguese

See the files iso_country_list_insert.sql and iso_country_list_insert_pt-br.sql, respectively. Copy your content and paste it in your DBMS. Runs and make the commit.

@vinicius-stutz
vinicius-stutz / README.md
Last active November 15, 2015 14:06
Flexible Google-style loader with CSS
@vinicius-stutz
vinicius-stutz / README.md
Created November 15, 2015 14:18
Cleanest CSS spinner, ever
@vinicius-stutz
vinicius-stutz / README.md
Created November 15, 2015 14:28
CSS Tools: Reset CSS

CSS Tools: Reset CSS

The goal of a reset stylesheet is to reduce browser inconsistencies in things like default line heights, margins and font sizes of headings, and so on. The general reasoning behind this was discussed in a May 2007 post, if you're interested. Reset styles quite often appear in CSS frameworks, and the original "meyerweb reset" found its way into Blueprint, among others.

The reset styles given here are intentionally very generic. There isn't any default color or background set for the body element, for example. I don't particularly recommend that you just use this in its unaltered state in your own projects. It should be tweaked, edited, extended, and otherwise tuned to match your specific reset baseline. Fill in your preferred colors for the page, links, and so on.

In other words, this is a starting point, not a self-contained black box of no-touchiness.

If you want to use my reset styles, then feel free! It's all explicitly in the public domain (I have to formally say that or else p

@vinicius-stutz
vinicius-stutz / README.md
Last active November 15, 2015 23:39
Get URL Sections In Javascript

Get URL Sections in Javascript

Even though most of the time to get information from the page URL you will use the server side programming language, you can actually use Javascript to get the different sections that make up the URL.

Get Protocol

To get the URL protocol use the following snippet.

window.location.protocol

Returns http / https

@vinicius-stutz
vinicius-stutz / README.md
Created November 16, 2015 01:22
Release Change in Wallpaper (Windows)

Release Change in Wallpaper (Windows)

Open the Windows Registry Editor (can be a text editor) and do:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\ActiveDesktop]
"NoChangingWallPaper"=dword:00000000

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System]
@vinicius-stutz
vinicius-stutz / README.md
Last active July 23, 2024 16:51
Máscara p/ telefones com 8 ou 9 dígitos (jquery.mask.js)