This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// functions.php | |
add_action("wp_enqueue_scripts", "css_styles", 1000); | |
function css_styles() | |
{ | |
// load previews | |
wp_enqueue_style( 'previews-css', '/previews'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
from django.http import HttpResponse | |
from django.conf import settings | |
from django.utils.deprecation import MiddlewareMixin | |
class BasicAuthMiddleware(MiddlewareMixin): | |
""" | |
Adopted from https://www.djangosnippets.org/snippets/2468/ for Django 5.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The Cyrillic language comparison table from https://en.wikipedia.org/wiki/Cyrillic_alphabets#Summary_table (chruch slavonic as last line!) | |
table = """ | |
А Б В Г Д Е Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ь Ю Я | |
А Б В Г Д Дж Дз Е Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ь Ю Я | |
А Б В Г Д Ѓ Ѕ Е Ж З И Ј К Л Љ М Н Њ О П Р С Т Ќ У Ф Х Ц Ч Џ Ш | |
А Б В Г Д Ђ Е Ж З И Ј К Л Љ М Н Њ О П Р С Т Ћ У Ф Х Ц Ч Џ Ш | |
А Б В Г Д Ђ Е Ж З З́ И Ј К Л Љ М Н Њ О П Р С С́ Т Ћ У Ф Х Ц Ч Џ Ш | |
А Б В Г Д Е Ё Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я | |
А Б В Г Ґ Д Е Ё Ж З І Й К Л М Н О П Р С Т У Ў Ф Х Ц Ч Ш ’ Ы Ь Э Ю Я |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Sample script to replace glyphs in an OTF/TTF font with SVG input. | |
- Round-trips via UFO, so not applicable to Variable fonts. | |
- Will subset the and remove the replaced glyphs from the resulting font. | |
""" | |
import os | |
import re | |
import sys | |
import click | |
import shutil |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.magic-carpet { | |
width: 100vw; | |
position: relative; | |
left: 50%; | |
right: 50%; | |
margin-left: -50vw; | |
margin-right: -50vw; | |
// fixed height | |
height: 250px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A helper script to try extract some reasonable defaults for a stylespace | |
document from a designspace. | |
You will in all likelyhood need to manually edit this generated stylespace, but | |
this saves a lot of the typing. | |
NOTE: That this assumes a well defined and valid designspace! | |
""" | |
from fontTools import designspaceLib as dsLib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Helper class that simulates some-of-what nativish | |
* scrolling that continues after dragging (explicit calls to scroll()) | |
* have stopped | |
*/ | |
// libraries | |
import $ from "./Zepto" | |
export default class Scroller { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Arduino geolocation bearing calculation based on two geolocation latitude-longitude values | |
* Johannes 'kontur' Neumeier, 2015 | |
* https://gist.github.com/kontur/794b04537a9bea84c40c | |
*/ | |
void setup() { | |
Serial.begin(9600); | |
Serial.println(getDirection(60.1650338, 24.8768908, 60.1243045, 26.2730065)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
// surprisingly this will not throw an error, but it won't import the file neither | |
.mx({ @import: "test2.less"; }); | |
} | |
body { | |
// this will throw an error: | |
// SyntaxError: Cannot read property 'rules' of undefined in /Users/johannes/test/less-bug/test.less on line 7, column 3: | |
// 6 body { | |
// 7 .mx({ @import "test2.less"; }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
boolean sketchFullScreen() { | |
return true; | |
} | |
void setup() { | |
size(displayWidth, displayHeight); | |
} |
NewerOlder