Git Product home page Git Product logo

luis-puhl.github.io's Introduction

luis-puhl.github.io

My resume and personal site (with some web tricks in the sleeve).

Here you can find my generic resume and some web triks to make it less boring.

Bootstrap

For responsivness and components (progress bar, jumbotron, footer, side menu) the twitter bootstrap went rigth in.

Sometime in the near future bootstrap will be removed in favor of material desing stuff from polymer.

HTML and CSS i18l

To provide a multilanguage site for every translatable text element you see in the page there are two (or more) source html code.

For each language there is an element with the attribute lang= set.

<h2 id="profile">
	<span lang="en">PROFILE</span>
	<span lang="pt-BR">PERFIL</span>
</h2>

In the CSS there is a selector that detects the document language and hides all elements that are not in this language.

html:not(:lang(pt-BR)) :lang(pt-BR),
html:not(:lang(en)) :lang(en){
	display: none;
}

For active traslantion, one html selector whose value is bind to the document language is also provided.

<select id="language-select" class="hidden-print"
	onchange="document.documentElement.lang=this.value">
	<option value="pt-BR">Português Brasileiro</option>
	<option value="en">English</option>
</select>

And at last, I did not find a way to check the browser's prefered language in HTML or CSS, so there is a JS snippet that gets this setting from the browser and sets the aforementioned select in the html.

CSS for print media

I'm lazy, so instead of making another document just to print and send formaly I've put some CSS to print this document nicely.

The resulting documens are LuísPuhl-Currículo.pdf for Portuguese and LuísPuhl-Resume.pdf for the English version.

Offline Site

I've put some work with Service Workers as defined in Mozilla Developer Network (MDN) and following the lead set by Matt Gaunt at the Google Developers page.

At the time of writing this doc, I'm using a modified race condition where the latest version is fetched from network and cached and the local copy is served for speed. It definitely needs improvements, but right now I don't know where and how exactly (I have no metric or test methodology to make my choice).

Firebase Counter

On the bottom of the page there is page view counter made with a Firebase Realtime Database as follows:

In the client we connect and immediately get and set the remote value and also set the HTML for the counter:

var config = {
	apiKey: 'AIzaSyBx2d4GDZlPuW__FouuyPnaQrvS_kjU9gM',
	authDomain: 'traker-ae14a.firebaseapp.com',
	databaseURL: 'https://traker-ae14a.firebaseio.com',
	storageBucket: 'traker-ae14a.appspot.com',
	messagingSenderId: '1034702936745'
};
firebase.initializeApp(config);
var counterRef = firebase.database().ref('counter');
var counter;
counterRef.once('value').then(function(dataSnapshot){
	counter = dataSnapshot.val() + 1;
	counterRef.set(counter);
	document.getElementById('pageviews').innerHTML = counter;
});

In the Firebase Realtime Database in the counter rules we allow for unauthenticated reads and writes, as long as they are incremented by one only:

{
	"rules": {
		".read": "auth != null",
		".write": "auth != null",
		"counter": {
			".read": true,
	 		".write": true,
			".validate": "data.exists() && newData.exists() && newData.val() == data.val() + 1"
		}
	}
}

Google analytics

At last, some analytics for feedback is essential, especially for a resume, so I can see who is looking for my skills. So far it's been bad, a lot o bounces.

Also, it is not enough, a proper feedback and contact form is needed.

luis-puhl.github.io's People

Contributors

luis-puhl avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.