Skip to content

Instantly share code, notes, and snippets.

View arnellebalane's full-sized avatar
drinking coffee

Arnelle Balane arnellebalane

drinking coffee
View GitHub Profile
@arnellebalane
arnellebalane / config.json
Created August 5, 2018 09:25
mdi-cli possible config format
{
"names": [
"google",
"youtube",
"twitter"
],
"size": 24,
"padding": 4,
"radius": 4,
"foreground": "#333",
@arnellebalane
arnellebalane / .gitignore
Last active June 19, 2020 19:58
managing secret configs with webpack
# no need to ignore entire "config" directory
secrets.json
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Welcome to Firebase Hosting</title>
<!-- update the version number as needed -->
<script defer src="/__/firebase/4.2.0/firebase-app.js"></script>
@arnellebalane
arnellebalane / index.js
Last active April 5, 2017 03:57
web share api demo
// progressive enhancement, use it only when it is available
if ('share' in navigator) {
// the object argument to navigator.share() should have at least
// one of the following keys: title, text, url
navigator.share({
title: 'The Web Share API',
text: 'The text that I want to share',
url: 'https://blog.arnellebalane.com/the-web-share-api'
})
@arnellebalane
arnellebalane / index.html
Created November 29, 2015 07:40
html5 geolocation api + google maps directions api to display user location and the name of the nearest road
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Geolocation API</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBdhHU9eaIJBJfoKj2fnpGRIJdcGBz07Qg&callback=displayMap" defer async></script>
@arnellebalane
arnellebalane / gist:b8c9321e3c94920aab3a
Last active August 29, 2015 14:05
git tracking remote branch
// make sure that the remote branch is
// available in the local repository
git fetch
// all of these create branch "develop"
// to track remote branch "origin/develop"
git branch develop origin/develop
git checkout -b develop origin/develop
git checkout --track origin/develop
@arnellebalane
arnellebalane / gist:b41ebbb747999d9e0366
Created August 24, 2014 03:36
using the FileReader api
// only files that are added through a file input field can be read
var input = document.querySelector('input[type="file"]');
// can also handle multiple files, but i'll just use one here
var file = input.files[0];
var reader = new FileReader();
reader.onload = function(e) {
var data = e.target.result;
// do anything with data, which is the file that has been read