Skip to content

Instantly share code, notes, and snippets.

@jwhitmarsh
jwhitmarsh / sequelize-left-join
Created July 9, 2015 14:05
Sequelize left join from two tables
Extraction.findAll({
where: {
archived: false
},
attributes: ['id', 'createdAt', 'updatedAt'],
include: [
{
model: ExtractionTemplate,
attributes: ['id'],
where: {
#!/bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: S 0 1 6
# Short-Description: nginx initscript
# Description: nginx
### END INIT INFO
@jwhitmarsh
jwhitmarsh / gist:de5a3f82e274f75239574377752e6256
Created February 2, 2017 10:49
upgrading postgres with homebrew
Assuming you've used home-brew to install and upgrade Postgres, you can perform the following steps.
Stop current Postgres server:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Initialize a new 9.5 database:
initdb /usr/local/var/postgres9.5 -E utf8
@jwhitmarsh
jwhitmarsh / how.md
Last active July 15, 2024 06:34
Fake low disk space on Xcode Simulator

Mount

hdiutil create -size 400m -fs HFS+ /tmp/400.dmg
hdiutil attach /tmp/400.dmg -mountpoint /Users/jwhitmarsh/Library/Developer/CoreSimulator/Devices/{guid}

Unmount

see list of volumes

mount

void main() {
DateTime? started;
if (started == null || started.year < 1900) {
print('no date');
}
}