Skip to content

Instantly share code, notes, and snippets.

View oowowaee's full-sized avatar

Tally oowowaee

View GitHub Profile
@vucalur
vucalur / paste_to_some_controller
Created June 28, 2014 08:02
UI-Router debugging snippet for CoffeeScript
$rootScope = @$scope.$root
$rootScope.$on('$stateChangeStart', (event, toState, toParams, fromState, fromParams) ->
console.log('$stateChangeStart to ' + toState.to + '- fired when the transition begins. toState,toParams : \n', toState, toParams);
console.log(arguments)
)
$rootScope.$on('$stateChangeError', (event, toState, toParams, fromState, fromParams) ->
console.log('$stateChangeError - fired when an error occurs during transition')
console.log(arguments)
@vstefanoxx
vstefanoxx / TableVerticalSplitHack.js
Last active February 22, 2023 14:50
Script to automatically split wide HTML tables that doesn't fit the width of the PDF page generated by WkHtmlToPdf (or equivalent). From an idea of Florin Stancu <niflostancu@gmail.com> and his script wkhtmltopdf.tablesplit.js, this implementation is quite different because the splitting is done vertically on a excessive wide table, while the or…
/**
* WkHtmlToPdf table vertically-splitting hack
* Script to automatically split wide HTML tables that doesn't fit the width of the PDF page generated
* by WkHtmlToPdf (or equivalent)
*
* The general idea come from Florin Stancu <niflostancu@gmail.com> and his script wkhtmltopdf.tablesplit.js
* The implementation is quite different because the splitting is done vertically on a excessive
* wide table, while the original script was meant to split horizontally an excessive long table
*
* To use, you must adjust pdfPage object's contents to reflect your PDF's
@bibstha
bibstha / gist:49540af53fa0ec5ab869
Last active February 5, 2021 07:47
Deploy to dokku from codeship.com

After migrating from heroku to dokku, we had to also chance codeship so we deploy to dokku. I followed the following steps to successfully deploy to dokku.

  1. Save the public key of the codeship project. It is found in Project Settings > General Settings.
  2. Copy the public key to a file /tmp/codeship_projectname.pub.
  3. Make sure when pasting, all the contents are in a single line and not multiple lines.
  4. Add the public key to dokku using the following command in console. Reference.
cat /tmp/codeship_projectname.pub | ssh root@yourdokkuinstance "sudo sshcommand acl-add dokku [description]"
@henrik
henrik / heroku_db_to_dokku_psql_single_container.sh
Last active October 30, 2018 20:48
Copying a Heroku DB to dokku-psql-single-container.
cd my_heroku_app
# Make sure DB doesn't update on Heroku. This may be enough depending on your needs.
heroku maintenance:on
# Dump from Heroku.
heroku pg:pull DATABASE_URL heroku_dump
pg_dump heroku_dump -Fc > /tmp/db.dump # Fc for binary dump (otherwise the import will complain)
# Restore to Dokku.