Skip to content

Instantly share code, notes, and snippets.

View alexandrevicenzi's full-sized avatar
:shipit:

Alexandre Vicenzi alexandrevicenzi

:shipit:
View GitHub Profile
@alexandrevicenzi
alexandrevicenzi / pdf.html
Created February 22, 2014 05:46
Plain text PDF with pdf.js
<!doctype html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://mozilla.github.io/pdf.js/build/pdf.js"></script>
<script>
function pdfToPlainText(pdfData) {
PDFJS.disableWorker = true;
var pdf = PDFJS.getDocument(pdfData);
@alexandrevicenzi
alexandrevicenzi / HttpClientExtensions.cs
Created February 25, 2014 20:11
C# Post, Put and Patch as JSON async extensions
using System;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Threading.Tasks;
namespace MyProject.Extensions
{
public static class HttpClientEx
{
public const string MimeJson = "application/json";
@alexandrevicenzi
alexandrevicenzi / index.html
Last active September 22, 2020 21:01
Bootstrap CSS Animate Loading Icon Button
<!-- Code snippet -->
<div class="form-group">
<div class="col-md-12 text-center">
<span class="glyphicon glyphicon-refresh glyphicon-refresh-animate"></span>
</div>
</div>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Which Browser?</title>
</head>
<body>
<p>You are using <span id="browser"></span> <span id="version"></span> on <span id="os"></span></p>
<script type="text/javascript" src="browserdetect.js"></script>
<script type="text/javascript">
@alexandrevicenzi
alexandrevicenzi / tus-auth.go
Created July 28, 2017 12:33
Tus Server with Authentication
package main
import (
"net/http"
"github.com/tus/tusd"
"github.com/tus/tusd/filestore"
)
func UserIsAuthenticated(r *http.Request) {
@alexandrevicenzi
alexandrevicenzi / fblogin.py
Created August 22, 2016 23:42
Python Tornado: Make email permission required when sign in with Facebook
#
# Read more:
# http://blog.alexandrevicenzi.com/required-email-facebook-login.html
#
import logging
import tornado.auth
import tornado.ioloop
import tornado.web
@alexandrevicenzi
alexandrevicenzi / README.md
Last active June 4, 2016 02:21 — forked from rikels/README.md
chromium os plugins

This scripts installs: Flash, PDF, for some Chromium OS builds.

All credits go to dz0ny, his script can be found here: https://gist.github.com/3065781 but this script didn't work for me and some more people. so i tried to do what his script did, but a little different. And also a big thanks to Jamison Lofthouse and Steve Pirk, as they got the Google Hangout plugin to work.

How to install?

  1. start Chromium OS.
@alexandrevicenzi
alexandrevicenzi / external_ip.py
Last active January 2, 2016 14:39
Find your external IP using Pyhton
#!/usr/bin/env python
# -*- encoding: UTF-8 -*-
import urllib
# Telize is a JSON IP and GeoIP REST API
url = 'http://www.telize.com/ip'
u = urllib.urlopen(url)
data = u.read()
@alexandrevicenzi
alexandrevicenzi / 0_reuse_code.js
Last active August 29, 2015 14:17
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