Skip to content

Instantly share code, notes, and snippets.

View dcalacci's full-sized avatar
🦩
wfh baby

Dan Calacci dcalacci

🦩
wfh baby
View GitHub Profile
@ag14spirit
ag14spirit / ethnicity-dropdown.html
Last active February 18, 2024 21:18
Form ethnicity drop down list
<fieldset>
<legend>Ethnicity</legend>
<select class="form-control dropdown" id="ethnicity" name="ethnicity">
<option value="" selected="selected" disabled="disabled">-- select one --</option>
<optgroup label="White">
<option value="White English">English</option>
<option value="White Welsh">Welsh</option>
<option value="White Scottish">Scottish</option>
<option value="White Northern Irish">Northern Irish</option>
<option value="White Irish">Irish</option>
@jiayuasu
jiayuasu / GeoSpark_Scala_New_Example.scala
Last active June 1, 2017 18:11
These Scala APIs work for GeoSpark 0.4 or later
/*---------------------------- GeoSpark 0.4 (or later) Scala API usage ----------------------------*/
/*
* If you are writing GeoSpark program in Spark Scala Shell, no need to declare the Spark Context by yourself.
* If you are writing a self-contained GeoSpark Scala program, please declare the Spark Context as follows and
* stop it at the end of the entire program.
*/
import org.apache.spark.SparkContext
import org.apache.spark.SparkConf
@jeygeethan
jeygeethan / reinstall_docker.sh
Last active November 17, 2019 07:11
reinstall docker on any machine
#!/usr/sh
sudo service docker stop && sudo apt-get purge -y docker-engine && sudo apt-get autoremove --purge -y docker-engine && sudo rm -rf /var/lib/docker && sudo apt-get update && sudo apt-get install -y docker-engine && sudo service docker start && sudo docker run hello-world && sudo usermod -aG docker $USER
@madx
madx / README.md
Last active March 30, 2016 16:41
Import Rdio collection to Google Play Music using gmusicapi

Usage

$ edit pm_imported.py
Replace USER and PASS with your own credentials
$ python pm_importer.py
# Enjoy.

(Requires python3 and gmusicapi)

@Shourai
Shourai / adb.sh
Last active August 19, 2020 08:34 — forked from olivier-m/adb.sh
Remove all Google apps from an android phone/tablet (Nexus 5 / Nexus 9 | Marshmallow 6.0.1).
# With your phone in debug mode, etc.
adb start-server
adb remount
adb shell < remove.sh
@bsergean
bsergean / README.md
Last active March 26, 2024 16:16
three.js + headless.gl rendering with texturing

Getting the code

git clone https://gist.github.com/08be90a2f21205062ccc.git

Executing the code

$ npm install # maybe npm start will take care of it but just in case
$ npm start && open out.png

> offscreen-sample@1.0.0 start /Users/bsergean/src/offscreen_sample

@mojodna
mojodna / README.md
Last active May 17, 2024 12:53
GDAL 2.0 on Amazon Linux
sudo yum -y update
sudo yum-config-manager --enable epel
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel
cd /tmp
curl -L http://download.osgeo.org/gdal/2.0.0/gdal-2.0.0.tar.gz | tar zxf -
cd gdal-2.0.0/
./configure --prefix=/usr/local --without-python
make -j4
sudo make install
@jmiserez
jmiserez / export_google_music.js
Last active December 20, 2023 01:45
(fixed/updated 2016-05-10) Export your Google Music Library and Playlists (Google Play Music All Access) (see http://webapps.stackexchange.com/questions/50311/print-playlist-from-google-play-music for more)
// Copyright 2016 Jeremie Miserez <jeremie@miserez.org>
//
// MIT License
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF O
@brianckeegan
brianckeegan / backbone_extractor.py
Last active August 2, 2023 19:26
Given a networkx graph containing weighted edges and a threshold parameter alpha, this code will return another networkx graph with the "backbone" of the graph containing a subset of weighted edges that fall above the threshold following the method in Serrano et al. 2008.
# Serrano, Boguna, Vespigani backbone extractor
# from http://www.pnas.org/content/106/16/6483.abstract
# Thanks to Michael Conover and Qian Zhang at Indiana with help on earlier versions
# Thanks to Clay Davis for pointing out an error
import networkx as nx
import numpy as np
def extract_backbone(g, weight='weight', alpha=.05):
backbone_graph = nx.Graph()
@mbostock
mbostock / .block
Last active March 2, 2024 12:15
Arc Tween
license: gpl-3.0