Skip to content

Instantly share code, notes, and snippets.

@inxilpro
inxilpro / README.md
Created July 22, 2022 21:01
Fully namespaced Tailwind config for widget or embeddable component

Sometimes you need to publish a CSS file for 3rd-party consumption (i.e. default styles for an embeddable JS widget). This set up lets you continue to use Tailwind, but scope all your styles to a specific selector.

Simply replace .internachi with your own widget namespace, set up Tailwind as you please, and run generate.sh to build a custom version of your Tailwind styles that won't interfere with other CSS rules (including the Tailwind reset).

@muxa
muxa / gate.yaml
Created September 18, 2021 06:25
ESPHome Gate single button control with State Machine
substitutions:
device_name: Gate
esphome:
name: gate
platform: ESP8266
board: d1_mini
on_boot:
priority: 600
then:
@ksopyla
ksopyla / polish_sentence_nltk_tokenizer.py
Last active September 19, 2022 07:29
A curated list of Polish abbreviations for NLTK sentence tokenizer based on Wikipedia text
import nltk
# interactive download
# nltk.download()
nltk.download('punkt')
extra_abbreviations = [
"ps",
"inc",
"corp",
@andrzejsliwa
andrzejsliwa / Makefile
Last active December 10, 2017 16:25
simple project for cross development with KICK ASSEMBLER for C64
VICE_REMOTE_MONITOR = true
VICE_REU = true
VICE_CARTRR = cartridge/rr38p-tmp12reu.bin
VICE_PATH = /Applications/x64.app/Contents/MacOS/x64
VICE_OPTS = +confirmexit -rrbioswrite
DEFAULT_PRG = learning
include c64_kickass.mk
Scenario Outline: Make an API request from a different domain
When I ask if a <http-method> request to <api-path> from a different domain is supported
Then I should receive a successful response
And the <http-method> request should be allowed
Scenarios: Available APIs
| http-method | api-path |
| GET | /api/v1/samples |
| GET | /api/v1/samples/1 |
| PUT | /api/v1/samples/1 |
@showell
showell / gist:1663926
Created January 23, 2012 15:51
object creation pattern
root = this
$ = jQuery
root.logger = do ($) ->
logContainer = null
write = (msg) ->
logContainer.append("<p>#{msg}</p>")
pub =
init: (el) -> logContainer = el
log: (msg) -> write msg
@fnhipster
fnhipster / html5.haml
Created April 9, 2011 01:19
HTML5 HAML Template
!!! 5
%html
%head
%title= "Your Website"
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%meta{ :content => "3 days", :name => "revisit-after" }
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
%link{ :href => "/css/screen.css", :media => "screen", :rel => "stylesheet" }
(function($){
$.widget("ui.mywidget", {
options: {
autoOpen: true
},
_create: function(){
// by default, consider this thing closed.