Skip to content

Instantly share code, notes, and snippets.

View jvrck's full-sized avatar
🎧
📡

Jim Vrckovski jvrck

🎧
📡
View GitHub Profile
@jvrck
jvrck / macos-show-hidden-files.sh
Created June 12, 2023 21:46
Show hidden files on MacOS
#!/bin/bash
# Source
# https://au.pcmag.com/macos/83540/how-to-access-your-macs-hidden-files
defaults write com.apple.Finder AppleShowAllFiles true
killall Finder
@jvrck
jvrck / docker-build-args.sh
Created August 1, 2022 22:59
Pass build arguments to docker from a file
# Takes args from build.args file
docker build -t new-tag-name $(for i in `cat build.args`; do out+="--build-arg $i " ; done; echo $out;out="") .
@jvrck
jvrck / mysql_db_size.sql
Created September 3, 2020 22:26
Get MySql Database Size
SELECT table_schema "DB Name",
ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB"
FROM information_schema.tables
GROUP BY table_schema;

Keybase proof

I hereby claim:

  • I am jvrck on github.
  • I am jvrck (https://keybase.io/jvrck) on keybase.
  • I have a public key ASCBmUopDEH49BJUWGjB40rKUXTstNfgDJVl_rBAHoBhTAo

To claim this, I am signing this object:

@jvrck
jvrck / gpg_fix.txt
Last active October 14, 2019 04:26 — forked from cezaraugusto/gpg_fix.txt
fixing `gpg failed to sign data` error on macOS
For troubleshooting, two things to first try:
brew install gnupg2
run `git config --global gpg.program gpg2`, to make sure git uses gpg2 and not gpg
run `echo "test" | gpg2 --clearsign`, to make sure gpg2 itself is working
If that all looks all right, one next thing to try:
run `brew install pinentry` to ensure you have a good tool installed for passphrase entry
If after that install and you re-try git commit and still get the "failed to sign the data" error:
@jvrck
jvrck / base64-encode-decode.js
Created March 29, 2019 02:26 — forked from sid24rane/base64-encode-decode.js
Node.js Base64 Encode Decode -> Image
var buffer = require('buffer');
var path = require('path');
var fs = require('fs');
function encode_base64(filename){
fs.readFile(path.join(__dirname,'/public/',filename),function(error,data){
if(error){
throw error;
}else{
var buf = Buffer.from(data);
@jvrck
jvrck / sql_server_optional_parameters.sql
Created August 4, 2015 23:18
SQL Optional Parameters (SQL Server)
/*
source: http://stackoverflow.com/questions/11092576/sql-query-with-optional-parameter-and-possible-null-column
Add optinal parameters to SQL scripts or sps
*/
select id, customername
from customertable
where
(referredby = @referredby OR @referredby is null) and
(field2 = @f2 OR @f2 is null)
@jvrck
jvrck / Get_Frequency_of_Column
Created March 17, 2015 00:15
Get Frequency of Column - Sql Server
Select [column_name], count(*)
From [dbo].[dupes]
Group By [column_name]
order by count(*) DESC