Skip to content

Instantly share code, notes, and snippets.

Fernando Bueno antenando

Block or report user

Report or block antenando

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@antenando
antenando / convert-encoding.sh
Created Aug 14, 2018 — forked from arpith20/convert-encoding.sh
Shell script to convert encoding of files to utf-8.
View convert-encoding.sh
#!/bin/bash
if [ $# -lt 1 ]
then
echo "Usage: "$0" <file_name>"
echo "Convert files to utf-8"
exit
fi
for i in $*
do
View Montreal-tips.md

to learn French (from Hasseb)

centre st louis 4285 Drolet St, Montreal, QC H2W 2L7 (514) 596-5800


View vscode favorite shortcuts.md

Visual Studio Code shortcuts I use often

Navigate:

  • F8: jump to next error
  • Ctrl--: go back to previous code location

Sidebar:

  • Cmd-Shift-F: search
@antenando
antenando / coverage.js
Created Feb 28, 2018 — forked from ebidel/coverage.js
CSS/JS code coverage during lifecycle of page load
View coverage.js
/**
* @author ebidel@ (Eric Bidelman)
* License Apache-2.0
*
* Shows how to use Puppeeteer's code coverage API to measure CSS/JS coverage across
* different points of time during loading. Great for determining if a lazy loading strategy
* is paying off or working correctly.
*
* Install:
* npm i puppeteer chalk cli-table
@antenando
antenando / cloudSettings
Last active Jul 11, 2018
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2018-07-11T02:23:51.479Z","extensionVersion":"v2.9.2"}
View Infrastructure.js
const fetch = (url) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
console.log(url)
switch(url.match(/\d[aA-zZ]$/)[0]) {
case "1a":
resolve({name: "Seb"})
// or try this instead:
// reject({error: "something went wrong while fetching " + url})
break;
View Infrastructure.js
let cache = new Map();
let pending = new Map();
function fetchTextSync(url) {
if (cache.has(url)) {
return cache.get(url);
}
if (pending.has(url)) {
throw pending.get(url);
}
@antenando
antenando / script-loaded.js
Created Dec 21, 2017 — forked from AllThingsSmitty/script-loaded.js
Check if any given script has loaded
View script-loaded.js
var myScript = document.createElement('script');
myScript.src = 'http://code.jquery.com/jquery-2.1.4.min.js';
myScript.onload = function() {
console.log('jQuery loaded.');
};
document.body.appendChild(myScript);
@antenando
antenando / cache_storage_size.js
Created Dec 15, 2017 — forked from ebidel/sw_caching_size.js
Print service worker cache sizes and overall bytes cached.
View cache_storage_size.js
/**
* @author ebidel@ (Eric Bidelman)
* License Apache-2.0
*/
// Prints the size of each cache in the Cache Storage API and the overall bytes cached.
async function getCacheStoragesAssetTotalSize() {
// Note: opaque (i.e. cross-domain, without CORS) responses in the cache will return a size of 0.
const cacheNames = await caches.keys();
@antenando
antenando / Frame.js
Created Dec 12, 2017 — forked from robertgonzales/Frame.js
Use React portals to render inside shadow dom and iframes
View Frame.js
class Frame extends Component {
componentDidMount() {
this.iframeHead = this.node.contentDocument.head
this.iframeRoot = this.node.contentDocument.body
this.forceUpdate()
}
render() {
const { children, head, ...rest } = this.props
return (
You can’t perform that action at this time.