Skip to content

Instantly share code, notes, and snippets.

View piotrfonte's full-sized avatar

Piotr Fonte piotrfonte

View GitHub Profile
@EllyLoel
EllyLoel / reset.css
Last active April 13, 2024 18:14
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/open-props@1.3.16/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
@irv
irv / transform.py
Created September 19, 2018 14:33
convert gentle word alignment to w3c annotations
import json
def main():
with open("word_aligned.json", "r") as f:
aligned = json.load(f)
transform(aligned["words"])
def transform(words):
enumerated = [{"word":i, "position":x} for x,i in enumerate(words)]
annotations = {"items": list(map(transform_annotation, enumerated))}
@cletusw
cletusw / .eslintrc
Last active February 29, 2024 20:24
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@ChaseFlorell
ChaseFlorell / uriSchemeWithHyperlinkFallback.js
Last active February 21, 2023 11:22
Ever want to launch a mobile app from within the browser, but ensure that the browser still redirects the user to the link if the app isn't installed? This took some fiddling around, but when the "ah ha" moment hit, the solution is really quite simple.
// tries to execute the uri:scheme
function uriSchemeWithHyperlinkFallback(uri, href) {
// set up a timer and start it
var start = new Date().getTime(),
end,
elapsed;
// attempt to redirect to the uri:scheme
// the lovely thing about javascript is that it's single threadded.
// if this WORKS, it'll stutter for a split second, causing the timer to be off
@simonscheiber
simonscheiber / sitemap.php
Created August 15, 2012 22:07
Kirby sitemap generator excluding invisible folders
<?php
$ignore = array('sitemap', 'error');
// send the right header
header('Content-type: text/xml; charset="utf-8"');
// echo the doctype
echo '<?xml version="1.0" encoding="utf-8"?>';
@jaigouk
jaigouk / meta-tags.md
Created March 8, 2012 18:26 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@grossbart
grossbart / Krautstiel.md
Last active September 4, 2015 22:25
Swiss Chard Recipe

Ingredients

  • 500g chard (Krautstiel)
  • 50g parmesan
  • 1 tablespoon breadcrumbs (crushed)
  • 1 garlic clove
  • thyme
  • rosemary