Skip to content

Instantly share code, notes, and snippets.

View DoomyTheFroomy's full-sized avatar
👀
Looking forward

Martin Rudolph DoomyTheFroomy

👀
Looking forward
View GitHub Profile
@mvan231
mvan231 / Strava Widget.js
Last active February 17, 2021 12:32
Display your current year to date stats
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: pink; icon-glyph: magic;
/*
$------------>
created by:
mvan231
@ChristophObermeier
ChristophObermeier / AirQuali_fix.js
Last active June 17, 2022 19:29
iOS Scriptable Widget for current Air Quality / Pollution in your city #stayhealthy #enjoyfreshair #stopcancer.
// ***Air Quality Widget***
//
// Copyright (C) 2020 by ChristophObermeier
//
// Permission to use, copy, modify, and/or distribute this software is hereby granted.
// However you have to respect the Terms of Service of the Air Quality Open Data Platform: https://aqicn.org/api/tos/
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
import sinonStubPromise from 'sinon-stub-promise';
import sinon from 'sinon'
sinonStubPromise(sinon)
let stubedFetch = sinon.stub(window, 'fetch') )
window.fetch.returns(Promise.resolve(mockApiResponse()));
function mockApiResponse(body = {}) {
@ericclemmons
ericclemmons / example.md
Last active April 24, 2024 18:09
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 Summary Goes Here
@alopresto
alopresto / gpg_git_signing.md
Last active January 18, 2024 22:42
Steps to enable GPG signing of git commits.

If anyone is interested in setting up their system to automatically (or manually) sign their git commits with their GPG key, here are the steps:

  1. Generate and add your key to GitHub
  2. $ git config --global commit.gpgsign true ([OPTIONAL] every commit will now be signed)
  3. $ git config --global user.signingkey ABCDEF01 (where ABCDEF01 is the fingerprint of the key to use)
  4. $ git config --global alias.logs "log --show-signature" (now available as $ git logs)
  5. $ git config --global alias.cis "commit -S" (optional if global signing is false)
  6. $ echo "Some content" >> example.txt
  7. $ git add example.txt
  8. $ git cis -m "This commit is signed by a GPG key." (regular commit will work if global signing is enabled)
@samwize
samwize / mocha-guide-to-testing.js
Created February 8, 2014 05:53
Explain Mocha's testing framework - describe(), it() and before()/etc hooks
// # Mocha Guide to Testing
// Objective is to explain describe(), it(), and before()/etc hooks
// 1. `describe()` is merely for grouping, which you can nest as deep
// 2. `it()` is a test case
// 3. `before()`, `beforeEach()`, `after()`, `afterEach()` are hooks to run
// before/after first/each it() or describe().
//
// Which means, `before()` is run before first it()/describe()
@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active May 24, 2024 01:23
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@efeminella
efeminella / ios-html5-input-element-tips.html
Last active February 27, 2017 07:44
An example which demonstrates how to override default behaviors of the iOS Keyboard for Mobile Web Applications.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title>iOS HTML5 input element Example</title>
<meta name="author" content="Eric Feminella" />
<script src="http://code.jquery.com/jquery.min.js"></script>
<style>
@sergeyromanov
sergeyromanov / zip_codes.pl
Last active October 12, 2015 10:27
Scrape St. Petersburg ZIP codes by district
#!/usr/bin/env perl
use 5.014;
use Encode qw(decode);
use Mojo::UserAgent;
use List::MoreUtils qw(pairwise);
use YAML qw(DumpFile);
my $SOURCE_URL = 'http://www.spbindex.ru/listindex.html';
my $OUT_FILE = 'sp_indices.yml';
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method: