Skip to content

Instantly share code, notes, and snippets.

@ricjcosme
ricjcosme / dump-restore
Created September 13, 2017 17:33
DUMP / RESTORE PostgreSQL Kubernetes
DUMP
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
kubectl exec [pod-name] -- bash -c "pg_dump -U [postgres-user] [database-name]" > database.sql
RESTORE
// pod-name name of the postgres pod
// postgres-user database user that is able to access the database
// database-name name of the database
@jedfoster
jedfoster / rasterize.js
Created August 29, 2015 19:21
Improved PhantomJS rasterize script
// Takes a screenshot of a URL or HTML string. Optionally, set viewport size
// and resolution, or capture only a specific element
//
// Usage: `phantomjs rasterize.js URL|[or URI encoded HTML string] output size scale element`
//
// Examples:
// `phantomjs rasterize.js http://google.com google.png`
// `phantomjs rasterize.js http://google.com img/google-logo.png auto 1 \#hplogo`
// `phantomjs rasterize.js %3Chtml%3E%3Cbody%3E%3Ch1%3EHello%20world!%3C%2Fh1%3E%3C%2Fbody%3E%3C%2Fhtml%3E hello-world.png
//
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active April 20, 2025 17:02
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>