Skip to content

Instantly share code, notes, and snippets.

@michaellouieloria
michaellouieloria / gist:0ff4376475b68e1e78c2
Created September 18, 2014 08:04
PDFtk commands to create fdf and fill form
create fdf
pdftk form.pdf generate_fdf output data.fdf
fill form
pdftk form.pdf fill_form data.fdf output form_with_data.pdf
To relink, run:
brew unlink git && brew link git
Use brew git
brew install git
brew link --overwrite git
@michaellouieloria
michaellouieloria / gist:ff83ed5f27c67bf0b7d4107e83fd6c9a
Last active February 3, 2021 20:02
allow virtual camera in ms teams macos
https://answers.microsoft.com/en-us/msteams/forum/msteams_tfb-msteams_tfmac/microsoft-teams-mac-os-client-is-not-recognizing/d9e863be-d9a4-4d03-a4b8-1b5c7df58828
https://docs.microsoft.com/en-us/answers/questions/148337/virtual-cam-broken-for-teams-version-130028778-mac.html
sudo codesign --remove-signature "/Applications/Microsoft Teams.app"
sudo codesign --remove-signature "/Applications/Microsoft Teams.app/Contents/Frameworks/Microsoft Teams Helper.app"
sudo codesign --remove-signature "/Applications/Microsoft Teams.app/Contents/Frameworks/Microsoft Teams Helper (GPU).app"
sudo codesign --remove-signature "/Applications/Microsoft Teams.app/Contents/Frameworks/Microsoft Teams Helper (Plugin).app"
@michaellouieloria
michaellouieloria / gist:7aec2e01317414509b0d473eab08d539
Created May 19, 2020 19:16
Heroku: Copying environment variables from an existing app to another
heroku config -s -a existing-heroku-app > config.txt
cat config.txt | tr '\n' ' ' | xargs heroku config:set -a new-heroku-app
or
heroku config -s -a existing-heroku-app | tr '\n' ' ' | xargs heroku config:set -a new-heroku-app
@michaellouieloria
michaellouieloria / ExcelFormulas.js
Last active March 27, 2020 05:34 — forked from pies/ExcelFormulas.js
Few Excel formulas - PMT, PPMT, XIRR - expressed in Javascript
/* Based on
* - EGM Mathematical Finance class by Enrique Garcia M. <egarcia@egm.co>
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1)
*/
var ExcelFormulas = {
PVIF: function(rate, nper) {
return Math.pow(1 + rate, nper);
},
@michaellouieloria
michaellouieloria / gist:f2ee272d1709a0e80f71
Last active August 4, 2019 12:10
Phantomjs in Facebook PHP webdriver
Use phantomjs. Start it:
$ phantomjs --webdriver=127.0.0.1:8910
Use:
require_once('lib/__init__.php');
$host = '127.0.0.1:8910';
$capabilities = array(
WebDriverCapabilityType::BROWSER_NAME => 'phantomjs',
@michaellouieloria
michaellouieloria / gist:844a6305d31771cc5db9
Created September 18, 2014 05:25
Gulp Uncss multiple files
npm install glob --save-dev
npm install gulp-uncss --save-dev
var uncss = require('gulp-uncss');
var glob = require('glob');
gulp.task('uncss', function() {
gulp.src('public/css/dirty.css')
.pipe(uncss({
html: glob.sync('app/views/**/*.*')
https://wiki.postgresql.org/wiki/Apt
pgloader mysql://root@localhost/test2 postgresql://postgres:postgres@localhost:5432/tire_website_development
delete folders db and app/models in subtree-api and subtree-admin
add remote
git remote add subtree-models git@github.com:michaellouieloria/subtree-models.git
git remote add subtree-db git@github.com:michaellouieloria/subtree-db.git
add subtree
git subtree add --prefix=app/models subtree-models master
git subtree add --prefix=db subtree-db master
@michaellouieloria
michaellouieloria / redis-one-line--pattern-delete.sh
Created June 9, 2017 04:38 — forked from MattSurabian/redis-one-line--pattern-delete.sh
One liner for deleting based on a pattern in redis. KEYS supports wildcards, delete doesn't. No worries xargs to the rescue. You might not need HOST, or PORT depending on your setup. You might need to sudo BOTH commands depending on your setup.
redis-cli -h <HOST> -p <PORT> KEYS "<PATTERN>" | xargs -i% redis-cli -h <HOST> -p <PORT> DEL %