Skip to content

Instantly share code, notes, and snippets.

@JakubMarcinkowski
JakubMarcinkowski / table-copier.user.js
Created August 24, 2022 06:13
Userscript for Tampermonkey (maybe for other managers too). It just copy a table to clipboard. Pasteable into spreadsheets.
// ==UserScript==
// @name Table copier
// @version 0.1
// @description Copy a table to clipboard. Pasteable into spreadsheets.
// @author Jakub Marcinkowski <kuba.marcinkowski on g mail>
// @match http*://*/*
// @grant GM_registerMenuCommand
// @grant GM_setClipboard
// ==/UserScript==
@dave-cross
dave-cross / .eleventy.js
Last active April 13, 2020 23:30
A basic Image Sharp transformer for 11ty
const { JSDOM } = require("jsdom");
const responsiveImage = require("./src/js/responsive-image");
// Set the project root for use with Sharp.
global.__rootdir = __dirname;
module.exports = function(eleventyConfig) {
eleventyConfig.addPassthroughCopy("img");
eleventyConfig.addTransform("transform-sharp", async function(
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active July 19, 2024 18:06
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@robfletcher
robfletcher / TumblrToMiddleman.groovy
Last active November 5, 2019 14:15
Scrape markdown posts from a Tumblr blog and export for Middleman
/*
* This script will scrape text posts from a Tumblr blog and export them as `.md`
* files with YAML frontmatter ready to be used in a Middleman blog.
*
* Aliases are added for the _middleman-alias_ gem so Tumblr style URLs like
* `/post/{id}/{slug}` will redirect to the Middleman-style URL.
*
* Although I built this for migrating to Middleman it should be pretty easy to
* adapt this for any similar static site generator.
*/
@kylemcdonald
kylemcdonald / Matlab.pde
Last active August 29, 2015 14:02
Lomb-Scargle periodogram for Processing, ported from Matlab code, so it's very idiosyncratic and non-idiomatic. Original code published in "Ice Ages and Astronomical Causes: Data, Spectral Analysis and Mechanisms" available at http://books.google.com/books?id=P8ideTkMQisC&pg=PA289&dq=spectral+lomb+scargle&hl=en
float[] hann(float[] x) {
int n = x.length;
float[] result = new float[n];
for(int i = 0; i < n; i++) {
float weight = .5 * (1 - cos((TWO_PI * i) / (n - 1)));
result[i] = x[i] * weight;
}
return result;
}
int[][] result;
float time;
void setup() {
setup_();
result = new int[width*height][3];
}
void draw() {
for (int i=0; i<width*height; i++)
@sonderingheights
sonderingheights / svg-primer.md
Last active August 29, 2015 13:57
Oh wow, I can has SVG in my work now? Just some beginner hoarding some links up.
@dbreunig
dbreunig / ReporterSaveFileDescription.md
Last active January 22, 2021 16:07
A description of the data written to the Reporter App Dropbox save folder.

#Reporter Save File Schema

##The Reporter Export File

Reporter saves to your Dropbox account with plaintext JSON files, one for each day. When a Report is entered in the app a file is created for that day if it does not exist. Otherwise, the report is appended to the existing file. The save folder is located in 'Dropbox/Apps/Reporter-App/'.

Reporter save files are named according to the following convention:

YYYY-MM-DD-reporter-export.json
@hardywu
hardywu / post.rb
Last active December 19, 2015 05:58
A rails model for gollum-lib, which is used to embed `gollum` into existing rails project. The `unindexable` and `unreadable` statuses are introduced. The `pull` and `push` method is added to have the git repository sync with its **remote origin**.
class Post
@data = Gollum::Wiki.new('doc/blog.git', :mathjax => true)
@@unindexable = 'page'
@@unreadable = 'pending'
def self.data
@data
end
def self.reload
@stonehippo
stonehippo / RPi-Dashing-howto.md
Last active October 6, 2021 13:52
Setting up a Raspberry Pi as a dashboard server with Dashing

Setting up a Raspberry Pi as a dashboard server with Dashing

Why the heck did I do this?

I wanted to set up one of my Raspberry Pi's as a data dashboard, pushing sensor data to a web interface that's easy to digest. I decided to use Shopify's Dashing framework. Dashing is based on Sinatra, and is pretty lightweight.

Dashing does require Ruby 1.9.3 to run. In addition, it makes use of the execjs gem, which needs to have a working Javascript interpreter available. Originally, I tried to get therubyracer working, but decided to switch over to Node.js when I ran into roadblocks compiling V8.

One warning: The RPi is a very slow system compared with modern multi-core x86-style systems. It's pretty robust, but compiling all this complex software taxes the system quite a bit. Expect that it's going to take at least half a day to get everything going.