Skip to content

Instantly share code, notes, and snippets.

View mhauken's full-sized avatar

Marius Hauken mhauken

View GitHub Profile
@Shpigford
Shpigford / .cursorrules
Last active September 17, 2024 20:38
Cursor Rules
# Original instructions: https://forum.cursor.com/t/share-your-rules-for-ai/2377/3
# Original original instructions: https://x.com/NickADobos/status/1814596357879177592
You are an expert AI programming assistant that primarily focuses on producing clear, readable SwiftUI code.
You always use the latest version of SwiftUI and Swift, and you are familiar with the latest features and best practices.
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning.
- Follow the user’s requirements carefully & to the letter.
@eiriklv
eiriklv / data-modeling-stepwise-form.js
Created April 7, 2017 09:25
Data Modeling Stepwise Form Example
/**
* Modeling a step-wise form with data
*
* NOTE: The important thing is to be able to
* describe any requirement with the chosen data model
*
* NOTE: Another important thing is conventional interfaces
* and impedance matching. Data should just flow through the
* functions without needing to conform to many different interfaces
*/
@mhauken
mhauken / svgo.json
Last active April 16, 2018 08:13 — forked from bendc/svgo.json
Sketch's SVGO Compressor settings
{
"comment": "A modified svgo compression-settings for SVGO-compresspor by Marius Hauken. For more info, please check <https://github.com/BohemianCoding/svgo-compressor>",
"pretty": false,
"indent": 0,
"plugins": [
{
"name": "cleanupAttrs"
},
{
"name": "cleanupEnableBackground"

Screencapture and animated gifs

I say "animated gif" but in reality I think it's irresponsible to be serving "real" GIF files to people now. You should be serving gfy's, gifv's, webm, mp4s, whatever. They're a fraction of the filesize making it easier for you to deliver high fidelity, full color animation very quickly, especially on bad mobile connections. (But I suppose if you're just doing this for small audiences (like bug reporting), then LICEcap is a good solution).

Capturing (Easy)

  1. Launch quicktime player
  2. do Screen recording

screen shot 2014-10-22 at 11 16 23 am

@sergejmueller
sergejmueller / ttf2woff2.md
Last active March 9, 2024 13:37
WOFF 2.0 – Learn more about the next generation Web Font Format and convert TTF to WOFF2
@mhauken
mhauken / __Useful.html
Last active April 6, 2018 09:24
Useful HTML snippets
<!--
&shy; = Soft hyphen. To break text where you want
-->
Onelongword&shy;thatwewant&shy;tobreak
@miguelmota
miguelmota / getDates.js
Last active February 7, 2024 23:43
Get dates in between two dates with JavaScript.
// Returns an array of dates between the two dates
function getDates (startDate, endDate) {
const dates = []
let currentDate = startDate
const addDays = function (days) {
const date = new Date(this.valueOf())
date.setDate(date.getDate() + days)
return date
}
while (currentDate <= endDate) {
@zachleat
zachleat / reading_time.rb
Last active October 21, 2020 23:00
Read this in X minutes Liquid Filter Plugin (for Jekyll)
# Outputs the reading time
# Read this in “about 4 minutes”
# Put into your _plugins dir in your Jekyll site
# Usage: Read this in about {{ page.content | reading_time }}
module ReadingTimeFilter
def reading_time( input )
words_per_minute = 180
@h3h
h3h / 0-resume-template.md
Last active July 28, 2016 13:07
Ideal Resume Format for a Software Engineer

https://github.com/[yourname]

Ambition

[Describe ambitions: type of work, attributes of team, what you want to learn & teach]

Experience

[in reverse chronological order, list at most 5 positions or 10 years back, whichever is fewer]

@technopagan
technopagan / style.css
Created December 5, 2012 12:49 — forked from iansoper/dabblet.css
Progressive Enahncement to use SVG sprites with PNG fallback for IE6+7
/**
* Progressive Enahncement to use SVG sprites with PNG fallback for IE6+7
*
* The trick:
* Legacy IE does not support rgba values.
* By defining a rgba background color together with the
* SVG background image for all modern browsers, legacy IE
* will ignore the SVG and use the
* first background definition containing the fallback PNG
*