Skip to content

Instantly share code, notes, and snippets.

View oprearocks's full-sized avatar
🏖️
AFO — Away From the Office

Adrian Oprea oprearocks

🏖️
AFO — Away From the Office
View GitHub Profile
@oprearocks
oprearocks / get-social-image-url.js
Created December 27, 2021 13:39
Dynamically create a social sharing image using Cloudinary (text-over-image)
// Customize this by adding your own Cloudinary bucket url
const urlBase = 'https://res.cloudinary.com/<your-bucket-here>/image/upload';
// Tweak text size, position, font and color
const titleOptions =
'w_1200,h_628,c_fill,q_auto,f_auto/w_800,c_fit,co_rgb:232129,g_south_west,x_300,y_254,l_text:arial_64_bold';
// Tweak text size, position, font and color
const textOptions = 'w_800,c_fit,co_rgb:232129,g_north_west,x_300,y_415,l_text:arial_38';
<--- Last few GCs --->
[16:0x3adbea0] 401451 ms: Mark-sweep 1423.3 (1538.3) -> 1423.3 (1522.3) MB, 933.3 / 0.0 ms (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 933 ms) last resort GC in old space requested
[16:0x3adbea0] 402346 ms: Mark-sweep 1423.3 (1522.3) -> 1423.2 (1522.3) MB, 893.6 / 0.0 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>qbox.me</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
@oprearocks
oprearocks / encoding-video.md
Created September 12, 2017 06:50 — forked from Vestride/encoding-video.md
Encoding video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aacc --with-opus
@oprearocks
oprearocks / wkhtmltopdf@Debian8.sh
Created August 18, 2017 08:26 — forked from fedir/wkhtmltopdf@Debian8.sh
Install wkhtmltopdf on Debian 8
apt-get update
aptitude install xfonts-base xfonts-75dpi fontconfig xvfb
mkdir ~/src/wkhtmltopdf -p
cd ~/src/wkhtmltopdf
wget https://bitbucket.org/wkhtmltopdf/wkhtmltopdf/downloads/wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
dpkg -i wkhtmltox-0.13.0-alpha-7b36694_linux-jessie-amd64.deb
echo 'xvfb-run --server-args="-screen 0, 1024x768x24" /usr/local/bin/wkhtmltopdf $*' > /usr/bin/wkhtmltopdf.sh
chmod a+rx /usr/bin/wkhtmltopdf.sh
ln -s /usr/bin/wkhtmltopdf.sh /usr/local/sbin/wkhtmltopdf
/usr/local/sbin/wkhtmltopdf https://www.google.fr output.pdf
168 wget http://download.gna.org/wkhtmltopdf/0.12/0.12.2/wkhtmltox-0.12.2_linux-jessie-amd64.deb
169 ls
170 sudo apt-get install libjpeg8 libpng12-0 xfonts-base xfonts-scalable
171 sudo apt-get install libpng12-0 xfonts-base xfonts-scalable
172 sudo dpkg -u wkhtmltox-0.12.2_linux-jessie-amd64.deb
173 sudo dpkg -i wkhtmltox-0.12.2_linux-jessie-amd64.deb
174 sudo apt-get install xfonts-75dpi
175 sudo dpkg -i wkhtmltox-0.12.2_linux-jessie-amd64.deb
176 sudo cp /usr/local/bin/wkhtmltopdf /usr/bin/
177 sudo cp /usr/local/bin/wkhtmltoimage /usr/bin/
docker login -u AWS \
-p <HUGE_BASE64_ENCODED_LOOKING_TOKEN> \
https://my-amazon-account.dkr.ecr.us-east-1.amazonaws.com
function ecr-login --description 'Get AWS ECR login for configured account'
~/Library/Python/3.6/bin/aws ecr get-login --no-include-email --region $argv
end