Skip to content

Instantly share code, notes, and snippets.

@bre7
bre7 / ios.md
Created April 10, 2022 19:01
Running Xcode 13.2.1 on iPhone iOS 15.3+

Credits to https://developer.apple.com/forums/thread/702220

  1. Download latest ZIP from https://github.com/iGhibli/iOS-DeviceSupport/tree/master/DeviceSupport
  2. Paste ZIP file contents to /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport

E.g.

mkdir -p ./ios-dd/ && wget -qO- https://github.com/iGhibli/iOS-DeviceSupport/raw/master/DeviceSupport/15.4(FromXcode_13.3(13E113)).zip | bsdtar -xvf- -C ./ios-dd/ && mv ./ios-dd/* /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/ && rm -rf ./ios-dd
@bre7
bre7 / RemoveDupfromPATH.ps1
Created January 26, 2022 20:58 — forked from gitsoup/RemoveDupfromPATH.ps1
Windows Powershell to remove duplicate PATH variables
#---------------------------------------------------------------------------------
#The sample scripts are not supported under any Microsoft standard support
#program or service. The sample scripts are provided AS IS without warranty
#of any kind. Microsoft further disclaims all implied warranties including,
#without limitation, any implied warranties of merchantability or of fitness for
#a particular purpose. The entire risk arising out of the use or performance of
#the sample scripts and documentation remains with you. In no event shall
#Microsoft, its authors, or anyone else involved in the creation, production, or
#delivery of the scripts be liable for any damages whatsoever (including,
#without limitation, damages for loss of business profits, business interruption,
@bre7
bre7 / watermark_with_image.rb
Created June 16, 2021 17:33 — forked from adityashedge/watermark_with_image.rb
Watermark images with ImageMagick 'convert' using 'composite', 'watermark' and 'dissolve' in Ruby
# Watermarking image with another image using Imagemagick 'composite', 'watermark' and 'dissolve'.
require "RMagick"
# Read the image in the memory with RMagick
img = Magick::Image.read("/home/aditya/Pictures/old_england_pic.jpg").first
# the original image was in jpg format
# need to make the white background color transparent
# also changed the format to png since JPG does not support transparency.
# run the command below to create an image with transparent background using ImageMagick
@bre7
bre7 / Apps Script pdfToText utility.md
Created June 13, 2021 13:59 — forked from mogsdad/Apps Script pdfToText utility.md
For http://stackoverflow.com/questions/26613809, a question about getting pdf attachments in gmail as text. I got a little carried away - this does much more than asked.

Google Apps Script pdfToText Utility#

This is a helper function that will convert a given PDF file blob into text, as well as offering options to save the original PDF, intermediate Google Doc, and/or final plain text files. Additionally, the language used for Optical Character Recognition (OCR) may be specified, defaulting to 'en' (English).

Note: Updated 12 May 2015 due to deprecation of DocsList. Thanks to Bruce McPherson for the getDriveFolderFromPath() utility.

    // Start with a Blob object
    var blob = gmailAttchment.getAs(MimeType.PDF);
    
@bre7
bre7 / made-with-love.html
Created March 31, 2021 17:51 — forked from oliveratgithub/made-with-love.html
Various snippets to add "Made with love" to your website using HTML, CSS and JavaScript
<!-- Example #1 - no styling -->
Made with ❤ in Switzerland
Made with ♥ in Switzerland
Made with ♡ in Switzerland
Made with ❤️ in Switzerland
Made with ♥️ in Switzerland
<!-- Example #2 - inline-styled ❤ -->
Made with <span style="color: #e25555;">&#9829;</span> in Switzerland
Made with <span style="color: #e25555;">&hearts;</span> in Switzerland
@bre7
bre7 / aws-sdk-js-v3.md
Created February 10, 2021 19:46
aws-sdk-js-v3 S3 simple how-to guide

Just a really simple guide on using S3 aws-sdk-js-v3 / @aws-sdk/client-s3 Assuming @aws-sdk/client-s3 is installed:

How to stream file from S3 to Express

import { S3 } from "@aws-sdk/client-s3"

express.get(`/file/:id`, async (req, res) => {
  const s3 = new S3({
@bre7
bre7 / readme.md
Last active March 22, 2024 23:07
VirtualBox - Creating virtual machine from physical machine (Windows 10)

Creating virtual machine from physical hard drive partition

  1. Use Disk2Vhd and create a VHD for the partition you want to convert. (If using VirtualBox, disable Vhdx option)

  2. Open Windows 10's native Disk Management tool (Run > diskmgmt.msc). Attach VHD (Action > Attach VHD).

  3. Convert to MBR Disk using AOMEI Partition Assistant Demo (if there's another way please post a comment)

  4. Detach VHD

@bre7
bre7 / readme.md
Last active February 1, 2020 03:55
Protect PDFs in Windows using CLI
@bre7
bre7 / google.analytics.color.fixer.user.css
Last active February 11, 2019 14:45
Google Analytics Color Fixer
/* ==UserStyle==
@name Google Analytics color fixer
@namespace github.com/openstyles/stylus
@version 1.0.0
@description Swaps the default blue-based palette with a proper one. Thanks to https://learnui.design/tools/data-color-picker.html for the idea & color selection
@author You
@updateURL https://gist.githubusercontent.com/bre7/a0fb9886e8b4251cc1f69274fd0af96f/raw/google.analytics.color.fixer.user.css
@preprocessor stylus
==/UserStyle== */
@bre7
bre7 / README.md
Created November 8, 2018 01:54 — forked from hubgit/README.md
Remove metadata from a PDF file, using exiftool and qpdf. Note that embedded objects may still contain metadata.

Anonymising PDFs

PDF metadata

Metadata in PDF files can be stored in at least two places:

  • the Info Dictionary, a limited set of key/value pairs
  • XMP packets, which contain RDF statements expressed as XML

PDF files