Skip to content

Instantly share code, notes, and snippets.

@cmpscabral
cmpscabral / Country Currency Codes JSON
Created July 10, 2018 14:16 — forked from grosscorporation/Country Currency Codes JSON
currency symol, name, plural, and decimal digits for all major and minor currencies
[
{
"USD" : {
"symbol" : "$",
"name" : "US Dollar",
"symbol_native" : "$",
"decimal_digits" : 2,
"rounding" : 0,
"code" : "USD",
"name_plural" : "US dollars"
@cmpscabral
cmpscabral / cr2tojpeg
Last active July 6, 2022 18:43
convert RAW/CR2 to JPEG / resize
# convert raw to jpeg
for i in *.CR2; do sips -s format jpeg $i --out "${i%.*}.jpg"; done
# resize jpegs
for i in *.jpg; do sips -Z 2500 $i --out "./small/${i%.*}.jpg"; done
# convert to tiff with lzw compression
sips -s format tiff -s formatOptions lzw [file] --out [file]
# convert to jpeg lossless
@cmpscabral
cmpscabral / makeswap.sh
Created March 20, 2019 11:16
swap file memory
mkdir -p swap1
cd swap1
dd if=/dev/zero of=swapfile bs=1M count=2000
mkswap swapfile
swapon swapfile
chmod 600 swapfile
@cmpscabral
cmpscabral / firebird
Last active June 26, 2019 13:48
firebird export
1) download firebird 2.5
2) install as a service
3) connect to database
> isql.exe <databasefile> -u sysdba -p masterkey
4) show tables
SQL> show tables
@cmpscabral
cmpscabral / pdfconvert-a
Last active October 15, 2019 11:37
convert PDF to PDF/a
gs -dPDFA -dBATCH -dNOPAUSE -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile=output.pdf input.pdf
@cmpscabral
cmpscabral / gist:b650be23cd37cdfc9f3213c2ae53d201
Created February 17, 2020 12:11
forward traffic to virtual machine
echo "
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443
" | sudo pfctl -ef -
@cmpscabral
cmpscabral / webpack-cache-chunk.js
Created April 6, 2020 16:34
quasar, cache busting, webpack, keep names
// First add this to your webpack config:
mix.webpackConfig({
output: {
chunkFilename: '[name].js?id=[chunkhash]',
}
});
//Then, when you specify the chunk name using this: /* webpackChunkName: "js/dashboard" */
//You will get this as a result: js/dashboard.js?id=0791710073c12eff5a3d in the webpack output dialog.
@cmpscabral
cmpscabral / pass-slots.md
Created June 8, 2020 11:52 — forked from loilo/pass-slots.md
Vue: Pass Slots through from Parent to Child Components

Vue: Pass Slots through from Parent to Child Components

The Situation

  • We've got some components A, B and C which provide different slots.
    const A = {
      template: `<div><slot name="a">Default A Content</slot></div>`
    }

const B = {

@cmpscabral
cmpscabral / quasar android
Last active June 24, 2020 22:33
quasar_android.md
# Install graddle
Download the Gradle Binary Only Distribution from https://gradle.org/gradle-download/
Open a terminal
Run the following to unzip the android sdk to the Development directory that is under your user home directory
unzip ~/Downloads/gradle-3.1-bin.zip -d ~/Development
Open up the vi editor and edit your bash profile. We need to add in the GRADLE_HOME environment variable
@cmpscabral
cmpscabral / adding-pixel-to-raspbian-lite.md
Created November 1, 2020 22:19 — forked from kmpm/adding-pixel-to-raspbian-lite.md
Adding PIXEL to Raspbian Lite

Adding PIXEL/GUI to Raspbian Lite

These 'notes' were primarily intended for my own consumption but since there have been surprisingly many comments to it over the years I wanted to do some updates and clarifications. Thanks for all comments.

These instructions will require you to have connection to internet from your pi, WiFi, Ethernet or by some other means like a 3G USB dongle or something.

Preparations