Skip to content

Instantly share code, notes, and snippets.

@zinkkrysty
zinkkrysty / gist:4247065
Created December 9, 2012 21:19
Best way to export and import postgres databases
# https://devcenter.heroku.com/articles/heroku-postgres-import-export
# Import
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
# Export
PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump
@zinkkrysty
zinkkrysty / 0_readme.markdown
Last active December 9, 2015 16:58 — forked from mrdanadams/create_origin.sh
Use Dropbox for a git repository in the cloud. I use it for backup purposes.
@zinkkrysty
zinkkrysty / padded_box_helper.rb
Created December 18, 2012 10:35
Automatic padding of bounding box in Prawn, and allows for filling in the background color. Currently only when specifying height, but I'm open to suggestions.
require 'prawn'
module PaddedBoxHelper
#
# Fills the background of the box you're in
#
def fill_bg_color color
float do
fill_color color
<div class="social">
<span class="twitter">
<a href="http://twitter.com/share" class="twitter-share-button" data-url="[your-url-here]">Tweet</a>
</span>
<span class="google">
<g:plusone size="medium" href="[your-url-here]"></g:plusone>
</span>
<span class="Facebook">
<iframe src="https://www.facebook.com/plugins/like.php?href=[your-url-here]&amp;show_faces=false&amp;layout=button_count" scrolling="no" frameborder="0" style="height: 21px; width: 100px" allowTransparency="true"></iframe>
</span>
@zinkkrysty
zinkkrysty / resolution_regex.md
Last active September 15, 2020 09:05
Screen resolution regular expression for Google Analytics

/^([0-9].*)x([1-8][0-9][0-9])$/

@zinkkrysty
zinkkrysty / _social_icons.css.sass
Created November 27, 2013 13:14
Rounded social icons sass snippet. Twitter, facebook, google+ and flexibility to add more.
// Image: http://f.cl.ly/items/3Q0G130q0g1Z0b3g471v/social_icons_rounded.png
//
// Rounded social icons 34x34
//
=social-icon-rounded($list-index)
background: image-url('social_icons_rounded.png') no-repeat $list-index*(-34px) 0
width: 34px
height: 34px
display: inline-block
@zinkkrysty
zinkkrysty / drawing_tool.js
Last active April 19, 2016 15:40
Drawing tool made with Bonsai.js (http://orbit.bonsaijs.org/)
var myStage;
var startDrag;
var myRect;
//
//Shape abstraction
//
//var RectShape = function(x, y, width, height){
// this.bonsaiRect = new Rect(x, y, width, height);
@zinkkrysty
zinkkrysty / designer.html
Created September 14, 2014 20:26
designer
<link rel="import" href="../topeka-elements/category-images.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-icons/av-icons.html">
<link rel="import" href="../paper-fab/paper-fab.html">
<polymer-element name="my-element">
<template>
<style>
@zinkkrysty
zinkkrysty / designer.html
Last active August 29, 2015 14:12
designer
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../core-item/core-item.html">
<polymer-element name="my-element">
<template>
@zinkkrysty
zinkkrysty / honeybadger-jquery.js
Created August 11, 2015 08:22
Catch errors in jQuery callbacks using Honeybadger. Slightly modified version, where it checks for both the presence of jQuery and Honeybadger objects.
// Generated by CoffeeScript 1.9.3
var honeybadgerAsyncForjQuery;
(honeybadgerAsyncForjQuery = function($) {
var _oldAjax, _oldEventAdd, _oldReady, honeybadgerAjaxWrapper, honeybadgerEventAdd, honeybadgerjQueryReadyWrapper;
if ((typeof $ == 'undefined') || (typeof Honeybadger == 'undefined')) {
return;
}
_oldEventAdd = $.event.add;
$.event.add = honeybadgerEventAdd = function(elem, types, handler, data, selector) {