Skip to content

Instantly share code, notes, and snippets.

View JMPerez's full-sized avatar

José M. Pérez JMPerez

View GitHub Profile
@JMPerez
JMPerez / yami-scripts.js
Created October 19, 2015 19:19
Fix for Yami's project
// in portfolio/public/scripts.js
// [...]
/**
* Returns an object with the query parameters passed in the
* hash of the URL
*/
function getHashParams() {
var hashParams = {};
var e, r = /([^&;=]+)=?([^&;]*)/g,
@JMPerez
JMPerez / test5.html
Created November 7, 2015 10:27
Test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="author" content="Carlos Coloma">
@JMPerez
JMPerez / index.html
Last active December 15, 2015 16:41
<html>
<body>
<a href="https://open.spotify.com/special/quicksilver">QS - OPEN</a>
<a href="http://open.jperez.cloud.spotify.net/qs">QS - REDIRECT</a>
</body>
</html>
@JMPerez
JMPerez / designs.md
Created January 4, 2016 10:55
Designs I like
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Coldplay on Spotify</title>
<meta http-equiv="X-UA-Compatible" content="IE=9">
<html>
<body>
Here is my SPB
<iframe src="https://open.jperez.cloud.spotify.net/embed/track/0TTGOEUDTC9oNsVZrpOk7s"></iframe>
</body>
</html>
@JMPerez
JMPerez / universal-data-fetching-superagent.js
Created July 16, 2016 19:08
Using the "browser" property in package.json (superagent)
{
"name": "superagent",
...
"browser": {
"./lib/node/index.js": "./lib/client.js",
...
},
...
"main": "./lib/node/index.js",
...
@JMPerez
JMPerez / universal-data-fetching-iso-http.js
Created July 16, 2016 19:09
Using the "browser" property in package.json (iso-http)
{
"name": "iso-http",
...
"main": "js/node/Http.js",
"browser": "js/browser/Http.js",
...
}
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<style>
a {
display: block;
padding: 1em;
}
</style>
</head>
@JMPerez
JMPerez / mediarecorder-api-screenflow-permission.js
Created December 17, 2016 14:43
Asking for permission to get access to window recording and camera
// we ask for permission to record the window
// mediaSource could also be 'screen' if we wanted
// to record the entire screen
const getStreamForWindow = () => navigator.mediaDevices.getUserMedia({
video: {
mediaSource: 'window'
}
});
// we ask for permission to record the audio and video from the camera
const getStreamForCamera = () => navigator.mediaDevices.getUserMedia({