Skip to content

Instantly share code, notes, and snippets.

@pbw
pbw / index.html
Created January 14, 2025 15:06
Itunes podcast XML generator
<script id="channel-info-template" type="text/x-handlebars-template">
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<title>{{channelTitle}}</title>
<link>{{channelLink}}</link>
<language>{{channelLang}}</language>
<copyright>{{channelCopyright}}</copyright>
<itunes:subtitle>{{channelSubtitle}}</itunes:subtitle>
<itunes:author>{{channelAuthor}}</itunes:author>
@pbw
pbw / index.html
Created February 9, 2023 20:39
Personal Website
<link href='https://fonts.googleapis.com/css?family=Raleway:500,400,300,200,100' rel='stylesheet' type='text/css'>
<canvas class="container" id="container" role="main"></canvas>
<div class="content">
<h1 class="title">Jonas Badalic</h1>
<p class="desc">ambitious frontend developer.</p>
<ul class="contact">
<li><a href="mailto:[email protected]">[email protected]</a></li>
<li>
<a target="_top"href="https://codepen.io/JonasB/">Codepen</a></li>
<li>
@pbw
pbw / screenshots.js
Created September 30, 2022 16:33 — forked from dideler/screenshots.js
Quick way to take screenshots of webpages at different sizes. Not very efficient, but can make it fast later.
#!/usr/bin/env casperjs
/*
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes.
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed
*
* Usage:
* $ casperjs screenshots.js example.com
*/
@pbw
pbw / css.md
Created September 30, 2022 16:31 — forked from dideler/css.md
CSS Tips

Vertical centering

position: absolute;
top: 50%;
transform: translateY(-50%);

Translate is processed at the end, meaning it is based on the final element height. This means it works with any element, even dynamic heights. Of course it only works on relatively new browsers, but translate is well accepted and on the path to being ubiquitous. The style is also easy to understand and isn't hacky.

@pbw
pbw / code_review_checklists.md
Created September 30, 2022 16:31 — forked from dideler/code_review_checklists.md
Code review checklists. Leave your suggestions in a comment below!

Based on the article: Using checklists for code review

In general, people are pretty good at the code review process, but it's sometimes surprising what can slip through. A natural consequence of the way our brains look at the world is that it's easy to pay a lot of attention to small details and code style flubs, and completely miss the big picture.

Obviously, not everything is applicable for every change. If the review request isn't making any changes to UI, then skip the first two checklists entirely. If a change is a bug fix, typically don't review it for architecture and design principles.

Put the big stuff first (e.g. architecture). You don't want to work through a ton of small issues before realizing that everything has to be rewritten.

Do a pass through the code for each and every item in the checklist. By only looking for a very specific type of defect, each pass goes relatively quickly, even for large changes. Focu

@pbw
pbw / example.md
Created September 30, 2022 16:30 — forked from dideler/example.md
A python script for extracting email addresses from text files.You can pass it multiple files. It prints the email addresses to stdout, one address per line.For ease of use, remove the .py extension and place it in your $PATH (e.g. /usr/local/bin/) to run it like a built-in command.
@pbw
pbw / bootstrapping.md
Created September 30, 2022 16:29 — forked from dideler/bootstrapping.md
Bootstrapping - a list of useful resources to get up and running quickly

Welcome!

UPDATE: This list is no longer maintained. I've moved it to its own repo so you can send suggestions as Pull Requests. https://github.com/dideler/bootstrapping/

For feedback or suggestions, please send a tweet (@dideler). Gist comments don't notify me. Pull requests aren't possible with gists (yet), so I don't recommend forking because then I can't easily get the change.

Starring this gist will give me an idea of how many people consider this list useful.

@pbw
pbw / osx-for-hackers.sh
Created September 30, 2022 16:26 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@pbw
pbw / bottle_hello.py
Created September 30, 2022 16:19 — forked from drgarcia1986/bottle_hello.py
Python HelloWorld (WebFrameworks) Collection
# -*- coding: utf-8 -*-
from bottle import route, run
@route('/')
def index():
return '<h1>Hello World/h1>'
run(host='localhost', port=8000)
@pbw
pbw / gist:fc82a845a25fa56982d0f1bb87493411
Created September 30, 2022 16:19 — forked from sirleech/gist:2660189
Python Read JSON from HTTP Request of URL
# Load Json into a Python object
import urllib2
import json
req = urllib2.Request("http://localhost:81/sensors/temperature.json")
opener = urllib2.build_opener()
f = opener.open(req)
json = json.loads(f.read())
print json
print json['unit']