Skip to content

Instantly share code, notes, and snippets.

Here's how to install PostgreSQL and have it run automatically at startup, on an Ubuntu 10.04 virtual machine using Vagrant. This took me a while to figure out:

Add the default lucid32 base box to your vagrant, if you haven't already:

host> vagrant box add lucid32 http://files.vagrantup.com/lucid32.box 

Now make a new lucid32 virtual machine and install postgresql on it:

@paulkoegel
paulkoegel / mixed_layout.md
Last active December 11, 2015 19:28
Extended MarionetteLayout to which you can pass an array of region names and View instances (via .addViews()); automatically creates the required region DOM containers. SEE BELOW FOR CODE.

MixedLayout

MixedLayouts are our custom extension of MarionetteLayouts which we use to wrap a heterogeneous collection of Backbone Views. This allows us to change the contents of complex pages all at once while preventing zombie views and leaving certain static elements like Navigation, Toolbar, or FooterViews on the page.

Rationale and Raison d'être

Marionette's Composite and CollectionViews are limited to rendering all their associated collection's items with the same ItemView. For our homepage, e.g., we need to encapsulate various Views - TopView, CategoryView, QuoteOfTheDayView etc. - in dynamic order into one Marionette View construct that can be .closed() to prevent zombie views. The Marionette view component designed to encapsulate heterogeneous subviews is the Layout. However, we cannot use a vanilla MarionetteLayout for the homepage because a Layout relies

@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active July 7, 2024 19:32
A badass list of frontend development resources I collected over time.
@rodrigoSaladoAnaya
rodrigoSaladoAnaya / BootStrap.groovy
Last active December 19, 2015 14:58
How to integrating Vert-x in Grails using a PlatformManager. (Test)
//grails-app/conf/BootStrap.groovy
import org.vertx.java.platform.PlatformLocator
class BootStrap {
def vertxPlatformManager
def init = { servletContext ->
vertxPlatformManager = PlatformLocator.factory.createPlatformManager()
URL[] classpath = [new File('./src/verticles').toURI().toURL()]
vertxPlatformManager.deployVerticle(
@Kartones
Kartones / postgres-cheatsheet.md
Last active July 25, 2024 09:09
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@john2x
john2x / 00_destructuring.md
Last active July 9, 2024 01:38
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@slightfoot
slightfoot / list_notifier.dart
Last active September 7, 2023 19:21
List Notifier - 07/10/2020
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot & Scott Stoll
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / responsive_page.dart
Created September 6, 2023 18:34
Response Page - by Simon Lightfoot - Humpday Q&A - 6th September 2023
// MIT License
//
// Copyright (c) 2023 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / scale.dart
Last active September 13, 2023 19:30
Scale - by Simon Lightfoot - 13th September 2023 - #HumpdayQandA
// MIT License
//
// Copyright (c) 2023 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions: