Skip to content

Instantly share code, notes, and snippets.

escapedcat /
Created May 7, 2020 — forked from fcoury/
Encrypt/Decrypt a File using your SSH Public/Private Key on Mac OS X

A Guide to Encrypting Files with Mac OS X

This guide will demonstrate the steps required to encrypt and decrypt files using OpenSSL on Mac OS X. The working assumption is that by demonstrating how to encrypt a file with your own public key, you'll also be able to encrypt a file you plan to send to somebody else using their private key, though you may wish to use this approach to keep archived data safe from prying eyes.

Too Long, Didn't Read

Assuming you've already done the setup described later in this document, that is the public key you want to use, that id_rsa is the private key the recipient will use, and secret.txt is the data you want to transmit…


$ openssl rand 192 -out key
$ openssl aes-256-cbc -in secret.txt -out secret.txt.enc -pass file:key
escapedcat / get-npm-package-version
Created Oct 24, 2017 — forked from DarrenN/get-npm-package-version
Extract version from package.json (NPM) using bash / shell
View get-npm-package-version
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
escapedcat / regex-pattern.js
Last active May 18, 2016
Regex Chinese Mobilphone numbers
View regex-pattern.js
var regexp = /(1[34578]\d{9})/;
escapedcat /
Last active Feb 12, 2021
Tutorial: Cordova iOS build with fastlane, match and Jenkins

Cordova CI with Jenkins for iOS apps

Inspired by CI server on Mac OS for iOS using GitLab and Fastlane by @v_shevchyk we decided to write down our approach. This will be extended and improved over time.

So you want to deploy your Cordova app, but you hate opening xcode manually to archive and export and sign and cry? Try this. By this we mean we try to explain how to create the following CI (Jenkins) setup:

  • Build Cordova app
  • Create & sign your ipa file
  • Upload to HockeyApp (for Enterprise distribution)
escapedcat / Fastfile
Last active Apr 28, 2016
Cordova iOS App deployment to HockeyApp using Fastlane / Match / Gym; including code signing identity
View Fastfile
# Customise this file, documentation can be found here:
# All available actions:
# can also be listed using the `fastlane actions` command
# Change the syntax highlighting to Ruby
# All lines starting with a # are ignored when running `fastlane`
# By default, fastlane will send which actions are used
# No personal data is shared, more information on
escapedcat / package.json
Last active May 16, 2018
npm scripts including node-sass and autoprefixer
View package.json
"name": "foo",
"version": "1.0.0",
"description": "foo project",
"main": "index.js",
"scripts": {
"start": "npm run serve | npm run watch-css",
"serve": "./node_modules/.bin/http-server -p 8080",
"build-css": "./node_modules/node-sass/bin/node-sass app/sass/style.scss -o app/css/ && ./node_modules/postcss-cli/bin/postcss --use autoprefixer app/css/style.css -d app/css/",
"watch-css": "nodemon -e scss -x 'npm run build-css'"
escapedcat /
Created Sep 29, 2015 — forked from paulirish/
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.


Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
escapedcat / jSignatureDirective.js
Last active May 22, 2018
AngularJS Directive for jSignature (simple)
View jSignatureDirective.js
* based on:
* "jSignature": "2.0.2",
* "angular": "1.3.11",
* "jquery": "2.1.3"
* include at least these jSignature files:
* 'jSignature/src/jSignature.js',
escapedcat / yourCtrl.js
Last active Feb 13, 2018
angular-google-maps directions service example
View yourCtrl.js
addresses = addressService.query();
addresses.$promise.then(function (result) {
console.log('task query done');
return uiGmapGoogleMapApi;
.then( function(maps) {