Skip to content

Instantly share code, notes, and snippets.

View chris-tietgen's full-sized avatar

Chris Tietgen chris-tietgen

View GitHub Profile
@passivestar
passivestar / Editor.tres
Last active April 10, 2024 20:07
Godot editor theme
[gd_resource type="Theme" load_steps=12 format=3 uid="uid://7bvxnk5n5imx"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6h42l"]
content_margin_left = 10.5
content_margin_top = 8.75
content_margin_right = 10.5
content_margin_bottom = 8.75
bg_color = Color(0.117647, 0.117647, 0.117647, 1)
draw_center = false
border_color = Color(1, 1, 1, 0.137255)
@hiulit
hiulit / audio_stream_player_with_counter.gd
Created September 8, 2022 09:05
AudioStreamPlayer with a counter, which counts the seconds elapsed and emits a signal each second
extends AudioStreamPlayer
class_name AudioStreamPlayerWithCounter
signal playback_position_reached(number)
var counter: int
var previous_counter: int
func _ready() -> void:
@danpetitt
danpetitt / nvmuse.md
Last active April 12, 2024 12:23
Using nvmrc on Windows

Using nvmrc on Windows

Unfortunately nvm use on Windows does not change the node version to that specified in the .nvmrc file as its not supported on nvm for Windows: coreybutler/nvm-windows#388

So the easiest solution to this is to use a simple Powershell command that performs an approximation of the command as follows: nvm use $(Get-Content .nvmrc).replace( 'v', '' );

However, thats a bit awkward and we can do a bit more so instead, we can create an 'alias' to a function that calls the command instead:

function callnvm() {
@bessfernandez
bessfernandez / setting-up-html-storybook-app.md
Last active March 28, 2023 16:37
How to setup a simple Storybook HTML demo app

icon-storybook-default

Storybook for HTML

Storybook is all about writing stories. A story usually contains a single state of one component, almost like a visual test case.

Typically you see Storybook used for React or other frameworks, but the library has recently introduced the option to use HTML for your Storybook projects. As a prototyping tool or playground this is great! No larger scale knowledge of other frameworks needed.

Install Storybook HTML

@proddi
proddi / index.html
Last active November 19, 2023 16:26
A html template engine in vanilla javascript.
<body>
<p template="hello">
Hello <i>{name}</i>
</p>
<script>
var HelloTemplate = new Template(document.querySelector("[template=hello]"));
var clone = HelloTemplate.clone({ name: "John Doe" }).append();
clone.update({ name: "John Update" });
</script>
</body>
@dpalomar
dpalomar / .gitattributes
Created April 8, 2016 12:43
Fixing CRLF with gitattributes
From this [issue](https://github.com/puphpet/puphpet/issues/1025#issuecomment-157059174):
I know that this issue is closed, but as I spent a lot of time to understand what was going on, I made some researches and I can explain why this happen, and you can fix it.
Using git config core.autocrlf true can help, but not on a multi-developpers project.
This command has to be the same on each developper machine, and that's not always the case.
You have to use the .gitattributes provided in the puphpet archive and edit it as follow (carefull, this file need to be in your project root)
You also need to use an IDE that allow you to save/edit files as LF (like phpstorm). You can check the type of the file in the bottom right corner, in the status bar (you'll see LF or CRLF while a file is opened)
@malcomio
malcomio / dabblet.css
Created January 22, 2014 11:13
Table hover borders
/**
* Table hover borders
*/
table {
border-collapse: collapse;
}
tr {
border-bottom: 1px solid transparent;
border-top: 1px solid transparent;
@richardscarrott
richardscarrott / box.css
Last active December 30, 2023 00:37
Fading an element in from display: none; with CSS transitions.
.box {
display: block;
background: red;
width: 200px;
height: 200px;
opacity: 1;
}
.box-hidden {
display: none;
@ronanguilloux
ronanguilloux / MSWordHtmlCleaners.js
Created June 12, 2012 07:56
2 js solutions to clean nasty MS Word HTML pasted in any CMS + 2 server-side tips
var CleanWordHTML = function ( str )
{
str = str.replace(/<o:p>\s*<\/o:p>/g, "") ;
str = str.replace(/<o:p>.*?<\/o:p>/g, "&nbsp;") ;
str = str.replace( /\s*mso-[^:]+:[^;"]+;?/gi, "" ) ;
str = str.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, "" ) ;
str = str.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
str = str.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, "" ) ;
str = str.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
str = str.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;