Skip to content

Instantly share code, notes, and snippets.

View wiless's full-sized avatar
💭
I may be slow to respond.

wireless wiless

💭
I may be slow to respond.
View GitHub Profile
@wiless
wiless / downloadobs.go
Last active April 5, 2023 09:20
Downloads an observablehq and create dataflow script (ojs)
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io"
"log"
"net/http"
@larsvers
larsvers / .block
Last active January 9, 2023 11:16
Number of cities - with d3-hexgrid
license: mit
height: 500
border: no
@CodeMyUI
CodeMyUI / index.html
Created April 20, 2018 02:36
Quote Effect w/ Web Animation API
<blockquote contenteditable="true"><q>What we think, we become.</q>
<cite>Gautama Buddha</cite>
</blockquote>
@CodeMyUI
CodeMyUI / index.html
Created January 8, 2018 01:16
Messenger
<div id="messenger"></div>
@stephanbogner
stephanbogner / index.html
Last active October 24, 2022 12:33
Save svg from dom as file (great when working with d3)
<a id="downloadLink" href="" download="diagram.svg">Download ↓</a>
<svg id="svg" width="120" height="120">
<rect fill="#000000" x="10" y="10" width="100" height="100"></rect>
</svg>
<script type="text/javascript">
setDownloader('downloadLink', 'svg')
function setDownloader(linkId, svgId) {
// Get svg element
@husobee
husobee / main.go
Created December 22, 2015 02:16
simple golang http middleware chaining example
package main
import (
"fmt"
"net/http"
"time"
"golang.org/x/net/context"
"github.com/husobee/backdrop"
@pklaus
pklaus / rpi2-arch-linux-to-sdcard.sh
Last active September 1, 2019 01:21
Raspberry Pi 2: Arch Linux ARM to SDcard Script. This is for the Rapsberry Pi 2. For the RPi 1, see https://gist.github.com/pklaus/b92dfc72136d1509c2ed
#!/bin/bash
# <http://archlinuxarm.org/platforms/armv7/broadcom/raspberry-pi-2>
echo -e "\n\nArch Linux ARM to SD Card"
echo -e "for the Raspberry Pi 2"
echo -e "(and for the Raspberry Pi 3, if you don't need to use the unofficial arm64 variant)\n\n"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
@jamestalmage
jamestalmage / forward.md
Last active April 9, 2024 17:21
Using Firebase to Authenticate to Google Drive

Note: There is a lot of information here, but if I have provided a link, it is probably something you should click on and read. OAuth is a complex enough subject on it's own, and hacking these two services together only adds to it.

Even so, I have found Firebase's API to be simpler than almost any other OAuth solution I have explored. When all is said and done, the important bits of code related to authentication is actually less than 10 lines. If you have ever tried to implement your own OAuth flow before, you know how amazing that is.

In the end, it may be worth using Firebase for authentication, even if that's the ONLY thing you use it for.

@wiless
wiless / httpserver.go
Last active December 8, 2020 05:36
A Simple command line HTTP Server
package main
import (
"flag"
"fmt"
"html/template"
"io/ioutil"
"net"
"net/http"
"os"
@wiless
wiless / sumall.go
Created March 15, 2015 13:51
Example walk through interface and reflect
package main
import (
"reflect"
"strconv"
"fmt"
)
func sum(arguments ...interface{}) {