Skip to content

Instantly share code, notes, and snippets.

Get the Heroku db as detailed here:
http://devcenter.heroku.com/articles/pgbackups#exporting_via_a_backup
1. heroku pgbackups:capture
2. heroku pgbackups:url <backup_num> #=>backup_url
- get backup_num with cmd "heroku pgbackups"
3. curl -o latest.dump <backup_url>
Then locally do:
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
@aghuddleston
aghuddleston / Ext.ux.RowExpander.js
Last active August 29, 2015 14:01
Ext JS 4.1.1 RowExpander grid plugin updated to play nicer with checkboxes and clearing all expanded
/**
* @class Ext.ux.RowExpander
* @extends Ext.AbstractPlugin
* Plugin (ptype = 'rowexpander') that adds the ability to have a Column in a grid which enables
* a second row body which expands/contracts. The expand/contract behavior is configurable to react
* on clicking of the column, double click of the row, and/or hitting enter while a row is selected.
*
* @ptype rowexpander
*/
Ext.define('Ext.ux.RowExpander', {
@aghuddleston
aghuddleston / Paging.js
Last active August 29, 2015 14:00
Ext JS 4.1.1 paging toolbar override which aligns the paging buttons to the right side of the toolbar
// Ext JS 4.1.1 paging toolbar override which aligns the paging buttons
// to the right side of the toolbar. New config "alignPagingRight" set
// to true will cause the paging buttons to align right.
Ext.define('overrides.toolbar.Paging', {
override: 'Ext.toolbar.Paging',
initComponent : function() {
var me = this,
pagingItems = me.getPagingItems(),
userItems = me.items || me.buttons || [];
@aghuddleston
aghuddleston / Ext.ux.form.field.DateDisplayField.js
Last active August 29, 2015 13:58
Ext JS 4 extension for a date display field
Ext.define('Ext.ux.form.field.DateDisplayField', {
extend: 'Ext.form.field.Display',
alias: 'widget.datedisplayfield',
datePattern: 'Y-m-d',
valueToRaw: function(value) {
return Ext.util.Format.date(value, this.datePattern);
}
});
@aghuddleston
aghuddleston / PageSize.js
Created March 24, 2014 20:39
Ext JS 4 PageSize plugin from Sencha forums
/**
* Ext.ux.grid.PageSize
* http://www.sencha.com/forum/showthread.php?130787-Ext.ux.toolbar.PagingOptions&p=610981&viewfull=1#post610981
*/
Ext.define('Ext.ux.grid.PageSize', {
extend : 'Ext.form.field.ComboBox',
alias : 'plugin.pagesize',
beforeText : 'Show',
afterText : 'per page',
mode : 'local',
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
@aghuddleston
aghuddleston / FindUsersWithCircularFeed.scala
Created January 16, 2014 18:15
Gatling Simulation utilizing a circular feed
package mypackage
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.http.Headers.Names._
import akka.util.duration._
import bootstrap._
object FindUsersWithCircularFeed {
val usersSearchCrit = tsv("usersSearchCrit.tsv").circular
@aghuddleston
aghuddleston / Department.scala
Last active January 3, 2016 11:29
A Gatling-tool test case that does create/update/delete on an object, using the session userId as part of the object id. Using gatling-1.5.3.
package mypackage
import com.excilys.ebi.gatling.core.Predef._
import com.excilys.ebi.gatling.http.Predef._
import com.excilys.ebi.gatling.http.Headers.Names._
import akka.util.duration._
import bootstrap._
object Department {
val departmentScn = scenario("Department CRUD")
.exec(
@aghuddleston
aghuddleston / ClearButton.css
Last active August 9, 2022 16:45
Ext.ux.form.field.ClearButton - my version
.ext-ux-clearbutton {
width: 12px;
height: 12px;
background-image: url(./images/clear-text-icon.gif);
background-position: 0 0;
background-repeat: no-repeat;
-moz-user-focus: ignore; /* https://developer.mozilla.org/en/CSS/-moz-user-focus */
cursor: pointer;
position: absolute;
overflow: hidden; /* IE 6 :-( */
@aghuddleston
aghuddleston / Ext.ux.EmailWindow.js
Created April 10, 2013 19:49
Basic Ext JS 4 email window that shows a preset "to" list in a tooltip.
Ext.define('Ext.ux.EmailWindow', {
extend: 'Ext.window.Window',
alias: 'widget.email',
requires: [
'Ext.form.*',
'Ext.window.Window',
'Ext.data.*',
'Ext.Ajax',
'Ext.LoadMask'
],