Skip to content

Instantly share code, notes, and snippets.

@brownsmith
brownsmith / blatdocker.sh
Created May 31, 2018 10:10
Delete all docker images
#!/bin/bash
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@epintos
epintos / mediumOverviewStats.js
Created January 20, 2017 20:21
Export Medium Overview Stats to CSV
// Max value of the Minutes Read Graph
minutesReadMaxAxis = 810
// Max value of the Views Graph
viewsMaxAxis = 431
// Max value of the Visitors Graph
visitorsMaxAxis = 344
// First date of the graph (US Format)
initialDay = new Date('12/22/2016')
// Days in the graphs
@epintos
epintos / mediumStoriesStats.js
Last active January 22, 2023 10:39
Export Medium Stats Stores to CSV
// Run Inspector Console in chrome and copy and paste the following code in the /stats/stories view
function download(filename, text) {
var pom = document.createElement('a');
pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
pom.setAttribute('download', filename);
if (document.createEvent) {
var event = document.createEvent('MouseEvents');
event.initEvent('click', true, true);
@poshaughnessy
poshaughnessy / samsung-internet-versions-rough-guide.md
Last active October 5, 2020 12:53
Rough browser version guide for Samsung Internet

v1.x (v1.0: Chromium 18, v1.5 & v1.6: Chromium 28)

v1 logo

Originally based on the stock Android browser (AOSP), 2012.

"It was around early 2013 when we made [the decision to move to Chromium]. We shipped our first Chromium-based browser in one of the Galaxy S4 models released later in 2013." (Source)

  • v1.0 preloaded in Galaxy S4
  • v1.5 preloaded in Galaxy Note 3
@bryik
bryik / .block
Last active December 4, 2019 19:21
Anisotropic Filtering With and Without
license: mit
@michaelkoper
michaelkoper / backbone_pushstate_router.js
Last active October 5, 2016 21:28 — forked from tbranyen/backbone_pushstate_router.js
hijack links for pushState in Backbone. With open in new tab functionality.
// Use absolute URLs to navigate to anything not in your Router.
var openLinkInTab = false;
// Only need this for pushState enabled browsers
if (Backbone.history && Backbone.history._hasPushState) {
$(document).keydown(function(event) {
if (event.ctrlKey || event.keyCode === 91) {
openLinkInTab = true;
@cobyism
cobyism / gh-pages-deploy.md
Last active April 18, 2024 13:44
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@tbranyen
tbranyen / backbone_pushstate_router.js
Last active February 25, 2024 21:38
hijack links for pushState in Backbone
// All navigation that is relative should be passed through the navigate
// method, to be processed by the router. If the link has a `data-bypass`
// attribute, bypass the delegation completely.
$(document).on("click", "a[href]:not([data-bypass])", function(evt) {
// Get the absolute anchor href.
var href = { prop: $(this).prop("href"), attr: $(this).attr("href") };
// Get the absolute root.
var root = location.protocol + "//" + location.host + Application.root;
// Ensure the root is part of the anchor href, meaning it's relative.