Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View danielzen's full-sized avatar

Daniel Zen danielzen

View GitHub Profile
@soderlind
soderlind / Install.txt
Last active March 5, 2024 20:30
macOS DoH! (DNS over HTTPS) using cloudflared
1) Install cloudflared using homebrew:
brew install cloudflare/cloudflare/cloudflared
2) Create /usr/local/etc/cloudflared/config.yaml, with the following content
proxy-dns: true
proxy-dns-upstream:
- https://1.1.1.1/dns-query
- https://1.0.0.1/dns-query
@heybignick
heybignick / .block
Last active April 8, 2024 07:31
D3.js v4 Force Directed Graph with Labels
license: gpl-3.0
height: 600

create package.js

npm init -y

create tsconfig.json

tsc --init

install deps

@mgamini
mgamini / ajaxspreadsheet.js
Last active September 20, 2021 23:15
How to receive ajax data and store it in a Google spreadsheet
// Follow the instructions here: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
//
// That'll get you 80% of the way there. Unfortunately, you'll run into CORS and MIMETYPE errors, so make the following changes.
// ============================================================
// Your clientside script should actually look like this (jquery example):
// ============================================================
var data = {email: "email@address.com"}
// Create or open an existing Sheet and click Tools > Script editor and enter the code below
// 1. Enter sheet name where data is to be written below
var SHEET_NAME = "Sheet1";
// 2. Run > setup
// 3. Publish > Deploy as web app
// - enter Project Version name and click 'Save New Version'
// - set security level and enable service (most likely execute as 'me' and access 'anyone, even anonymously)
// 4. Copy the 'Current web app URL' and post this in your form/script action
// 5. Insert column names on your destination sheet matching the parameter names of the data you are passing in (exactly matching case)
@staltz
staltz / introrx.md
Last active April 20, 2024 14:15
The introduction to Reactive Programming you've been missing
@Stanback
Stanback / nginx.conf
Last active February 4, 2022 18:05
Example Nginx configuration for serving pre-rendered HTML from Javascript pages/apps using the Prerender Service (https://github.com/collectiveip/prerender).Instead of using try_files (which can cause unnecessary overhead on busy servers), you could check $uri for specific file extensions and set $prerender appropriately.
# Note (November 2016):
# This config is rather outdated and left here for historical reasons, please refer to prerender.io for the latest setup information
# Serving static html to Googlebot is now considered bad practice as you should be using the escaped fragment crawling protocol
server {
listen 80;
listen [::]:80;
server_name yourserver.com;
root /path/to/your/htdocs;
@aderowbotham
aderowbotham / purge-ban-domain-varnish.md
Last active May 24, 2022 19:55
Purge (ban) an entire domain in Varnish Cache 3

How to purge ('ban') an entire domain in Varnish Cache 3

#####EDIT: NB Ban is technically different from Purge. Banned objects remain in memory but banning is faster than purging. Read the Varnish 3 documentation here and here.

Purge may be a more appropriate action for your use-case; although the examples in the gist below work, it's not necessarily the best way of doing this.


@ryanj
ryanj / openshift.npm.md
Last active November 22, 2017 19:55
A Git-based workflow for making your existing Open Source node.js application OpenShift-compatible.

Want to deploy an existing node.js Github project on OpenShift?

Give this recipe a try:

Add our OpenShift starter-code to your existing GitHub-hosted node.js application code:

cd $YOUR_PROJECT_FOLDER # This script assumes that your project is a git repo, with a git remote hosted on github.com
git remote add upstream -m master git@github.com:ryanj/nodejs-custom-version-openshift.git
git pull -s recursive upstream master # merge in a basic OpenShift skeleton