Skip to content

Instantly share code, notes, and snippets.

@stammy
stammy / LiquidBlobs.swift
Last active February 14, 2024 23:32
Liquid Blob effect with SwiftUI
View LiquidBlobs.swift
//
// ContentView.swift
// LiquidCircles
//
// Created by Paul Stamatiou on 10/10/22.
//
import SwiftUI
struct ContentView: View {
@stammy
stammy / TipsView.swift
Created July 4, 2020 17:24
SwiftUI MicroAnimation example
View TipsView.swift
//
// TipsView.swift
// Stonks
//
// Created by Paul Stamatiou on 7/3/20.
//
import SwiftUI
import PlaygroundSupport
@stammy
stammy / index.xml
Created January 25, 2011 15:00
RSS Feed for Jekyll (feed/index.xml) - paulstamatiou.com
View index.xml
---
layout: nil
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title type="text" xml:lang="en">{{ site.root_desc }}</title>
<link type="application/atom+xml" href="http://paulstamatiou.com/feed/" rel="self"/>
<link type="text" href="http://paulstamatiou.com" rel="alternate"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
@stammy
stammy / paulgraham.com.js
Created September 24, 2012 06:52
dotjs file to make pg's essay's a bit more readable
View paulgraham.com.js
document.getElementsByTagName('font')[0].setAttribute('style', "line-height:1.8; font-size: 16px; color:#444; font-weight:300; font-family: 'Helvetica Neue';");
document.getElementsByTagName('table')[1].style.width = '500px';
@stammy
stammy / wordpress_importer.rb
Last active March 27, 2022 09:39
Import a WordPress database and generate markdown files for Jekyll
View wordpress_importer.rb
# View my Jekyll blog http://paulstamatiou.com and my jekyll migration post http://paulstamatiou.com/how-to-wordpress-to-jekyll/
#
#
# based on the import script by icebreaker, which is based on mojombo's
# https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
# https://gist.github.com/303570
# edited to rewrite image URLs to use my CloudFront URL
require 'rubygems'
require 'sequel'
@stammy
stammy / Rakefile
Created January 22, 2011 10:28
dirty hack of a rakefile I use to upload new images to cloudfront for jekyll blog posts
View Rakefile
# when I write new blog posts I usually have a temporary folder called new_post on my desktop
# that I place images I want to upload to amazon s3 (which is distributed as CF) and then
# get the appropriate URLs to put the images in my blog post
# I usually save files as some_slug.png and some_slug_1200.png
# with the latter being a larger version (1200px wide) of the first.
# a typical upload will include 20 files. 2 versions of some (sm and lg), and some orphans
# so this compares filenames and if it detects a larger version of a file,
# it links the the smaller image to the larger image (i use fancyzoom on my site)
# if not, it just links to the image
@stammy
stammy / jsonPlayground.swift
Created April 11, 2020 20:59
swift json codable with dynamic key
View jsonPlayground.swift
// this uses a dynamic coding key (StockKey) but does not work with nested objects (ideally quote should have many properties inside
import SwiftUI
import Combine
import Foundation
/* todo modify to work with json in format:
{
"AAPL":{"quote":{},"chart":[]},
"MSFT":{"quote":{},"chart":[]}
@stammy
stammy / ContentView.swift
Created January 4, 2022 02:54
Better Password Field
View ContentView.swift
//
// ContentView.swift
// BetterPasswordField
//
// Created by Paul Stamatiou on 1/3/22.
// Idea from https://twitter.com/Stammy/status/1478108590066089987
//
import SwiftUI
@stammy
stammy / _media-queries.scss
Last active December 20, 2019 11:57 — forked from anthonyshort/_media-queries.scss
because you should be using ems for accessibility (zoom level) in your media queries
View _media-queries.scss
// $mq-mobile-portrait : 320px !default;
// $mq-mobile-landscape : 480px !default;
// $mq-tablet-portrait : 640px !default; -- changed because i want my blog content is around this wide, not 768. you should let content & design determine your breakpoints
// $mq-tablet-landscape : 1024px !default;
// $mq-desktop : 1382px !default;
$mq-mobile-portrait : 20em !default;
$mq-mobile-landscape : 30em !default;
$mq-tablet-portrait : 40em !default;
$mq-tablet-landscape : 64em !default;
@stammy
stammy / firebase.html
Created November 28, 2012 10:46
Hello World Firebase
View firebase.html
<html>
<head>
<!--
+1 with firebase. now you just need to write a node app with regression logic
that listens to each new vote on each post and tracks value history to ignore and reset
any malicious db.set(0)'s people run in console when they find this completely
public script on your site. (Firebase is working on their security).
https://www.firebase.com/docs/
https://twitter.com/Stammy/status/272576842345615360
-->