Skip to content

Instantly share code, notes, and snippets.

View osvik's full-sized avatar
💭
Working

Osvaldo osvik

💭
Working
View GitHub Profile
@osvik
osvik / generic.html
Last active December 4, 2018 01:26
Responsive svg infographics
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Responsive infographic test - Generic</title>
<style type="text/css">
html,
body {
margin: 0;
@osvik
osvik / deferred-styles.html
Created August 31, 2018 18:17
Deferred CSS Styles - Faster html pages
<noscript id="deferred-styles">
<link rel="stylesheet" type="text/css" href="" />
</noscript>
<script>
var loadDeferredStyles = function() {
var addStylesNode = document.getElementById("deferred-styles");
var replacement = document.createElement("div");
replacement.innerHTML = addStylesNode.textContent;
document.body.appendChild(replacement);
addStylesNode.parentElement.removeChild(addStylesNode);
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@osvik
osvik / AddBrowserLanguagesAsClasses.js
Last active April 23, 2017 08:30
Add browser languages as CSS classes
/*jshint browser: true*/
/**
* Adds the content of navigator.languages or navigator.language as classes to body
* This script must be added after the opening <body> tag.
* @author Osvaldo Gago
*/
(function () {
/**
* @namespace Custom validation related
*/
var customValidation = {
/**
* Known str_replace funcion. Required in valida_nif_cif_nie
*/
str_replace: function(e, t, n) {
var j;
@osvik
osvik / emailTrack.php
Last active January 29, 2017 22:29
Class to create a GA email tracking pixel
<?php
/**
* @file Class to create a Google Analytics email tracking pixel.
* It will be used to integrate our html email generator "Fabricador"
*/
class EmailTrack {
public $GAtrackingID = 'UA-7467053-1'; // Replace by your Google Analytics Tracking ID
<?php
$salesforce_credentials = Universe::login();
if ( isset( $salesforce_credentials['instance_url'] ) && isset( $salesforce_credentials['access_token'] ) ) {
$universe_login_error = '';
$universe_login_error_description = '';
$instance_url = $salesforce_credentials['instance_url'];
@osvik
osvik / connect_and_insert.php
Created May 25, 2016 08:23
Connect to Universe
<?php
class Universe {
/**
* Logins in Salesforce for the API
*
* @return array Returns an associative array with 'access_token' and other
*/
public static function login() {