Skip to content

Instantly share code, notes, and snippets.

/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
Item.joins("LEFT JOIN comments ON comments.item_id=items.id AND comments.service='TRUE'")
.joins("LEFT JOIN comments c2 ON c2.item_id=items.id AND c2.service='TRUE' AND (COALESCE(c2.created_at, items.purchased_at) + INTERVAL items.service_interval YEAR) >= NOW() AND c2.id <> comments.id")
.where("(COALESCE(comments.created_at, items.purchased_at) + INTERVAL items.service_interval YEAR) < NOW()")
.where("c2.id IS NULL")
.where("items.service_interval IS NOT NULL AND items.service_interval > 0")
Item.joins("LEFT JOIN comments ON comments.item_id=items.id AND comments.service='TRUE'")
.joins("LEFT JOIN comments c2 ON c2.item_id=items.id AND c2.service='TRUE' AND (COALESCE(c2.created_at, items.created_at) + INTERVAL items.service_interval) >= NOW()")
.where("(COALESCE(comments.created_at, items.created_at) + items.service_interval) < NOW()")
vbell on
escape ``
hardstatus alwayslastline
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f %t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %m/%d %{W}%c %{g}]'
defutf8 on

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@webdestroya
webdestroya / load_cycle_check.sh
Created May 17, 2015 05:42
Check Load_Cycle_Count rate for drives
#!/bin/sh
drives=`sysctl -n kern.disks | awk '{for (i=NF; i!=0 ; i--) print $i }'`
echo "+------+-----------------+-----------------+---------+-----------+----------+"
echo "|Device|Model |Serial | Power | LCC | LCC/Hr |"
echo "+------+-----------------+-----------------+---------+-----------+----------+"
for drive in $drives
do
smartctl -A -i -v 7,hex48 /dev/${drive} | \

Keybase proof

I hereby claim:

  • I am webdestroya on github.
  • I am mrdempsey (https://keybase.io/mrdempsey) on keybase.
  • I have a public key ASCNsk1uwPwkQfovl_ACvcEyCa4qFID_h25SGNWaUF-Wego

To claim this, I am signing this object:

\set QUIET 1
-- formatting
\x auto
\set VERBOSITY verbose
\set ON_ERROR_ROLLBACK interactive
-- show execution times
\timing
-- limit paging
\pset pager off
Welcome to the Official PUBG Team Finding Discord Server!
=========================================================
To invite people to this server use [Pubgteamfinder.com](https://discord.gg/nZBCBFR) .

Some general guidelines
var MemoryStorage, e,
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
MemoryStorage = (function(superClass) {
extend(MemoryStorage, superClass);
function MemoryStorage() {
this.db = {};
}
@webdestroya
webdestroya / postgres.md
Last active May 23, 2023 04:54
Postgres commands for debugging

Process List

SELECT (NOW() - query_start) as duration, pid, usename, application_name, client_addr, client_port, backend_start, query_start,
wait_event, wait_event_type, state, query
FROM pg_stat_activity 
WHERE pid <> pg_backend_pid()
AND state <> 'idle'
ORDER BY query_start ASC;