Skip to content

Instantly share code, notes, and snippets.

@kevin-smets
kevin-smets / iterm2-solarized.md
Last active May 3, 2024 12:59
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)

Default

Default

Powerlevel10k

Powerlevel10k

@bomberstudios
bomberstudios / Change Font.sketchplugin
Last active May 7, 2022 17:50
Change font family for all text layers in Sketch
// Change font (ctrl a)
var doc = context.document,
selection = context.selection,
font_name = [doc askForUserInput:"Font name:" initialValue:"Arial"];
function check_layer(layer){
log(layer)
var className = layer.className()
log("Checking layer " + layer + " of klass: " + className)
if (className == "MSTextLayer") {
@runemadsen
runemadsen / description.markdown
Created September 26, 2011 15:23
Reverse polymorphic associations in Rails

Polymorphic Associations reversed

It's pretty easy to do polymorphic associations in Rails: A Picture can belong to either a BlogPost or an Article. But what if you need the relationship the other way around? A Picture, a Text and a Video can belong to an Article, and that article can find all media by calling @article.media

This example shows how to create an ArticleElement join model that handles the polymorphic relationship. To add fields that are common to all polymorphic models, add fields to the join model.

@gregersrygg
gregersrygg / OpenLayers-mobile-translate3d.html
Created April 11, 2011 16:08
Demo of OpenLayers with translate3d. Better performance for pinch/pan on iOS devices.
<!DOCTYPE html>
<html>
<head>
<title>OpenLayers Mobile</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="http://openlayers.org/dev/examples/" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0;">
<meta name="apple-mobile-web-app-capable" content="yes">
<link rel="stylesheet" href="style.mobile.css" type="text/css">
<script src="../OpenLayers.mobile.js"></script>