Skip to content

Instantly share code, notes, and snippets.

@Trapsta
Trapsta / paint.js
Created December 2, 2021 18:25
PaintApi
registerPaint('polygon-border', class {
static get inputProperties() {
return [
'--path',
'--border'
]
}
paint(ctx, size, properties) {
@Trapsta
Trapsta / cookly.js
Created August 20, 2019 10:17
Cookly util scripts
var multiply = window.devicePixelRatio > 1 ? 2 : 1;
$(document).ready(function () {
$(".img-class-card").each(function() {
$(this).attr("src", "https://image.cookly.me/"+"tr:h-"+Math.round($(this).width()*0.66*multiply)+",w-"+Math.round($(this).width()*multiply)+",pr-true,rt-auto/"+$(this).attr("data-img"));
});
$(".img-gallery").each(function(obj) {
$(this).attr("src", "https://image.cookly.me/"+"tr:h-"+Math.round($(this).parent().width()*0.66*multiply)+",w-"+Math.round($(this).parent().width()*multiply)+",pr-true,rt-auto/"+$(this).attr("data-img"));
});
$(".img-gallery-lazy").each(function(obj) {
@Trapsta
Trapsta / generate-ssh-key.sh
Created July 8, 2019 17:44 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@Trapsta
Trapsta / bash.sh
Last active April 12, 2019 15:09
Ubuntu
tar -C /myfolder -zxvf yourfile.tar.gz
cp -r /blog/. ~/blog
@Trapsta
Trapsta / react-native
Created March 21, 2019 10:49
React Native Ops
1.export JAVA_HOME=readlink -f $(which java)
adb -s <device name> reverse tcp:8081 tcp:8081
adb shell input keyevent 82
@Trapsta
Trapsta / s3-invalidation.js
Created February 27, 2019 13:23 — forked from supinf/s3-invalidation.js
AWS Lambda script:: CloudFront Invalidations which are triggered by s3 events.
console.log('Loading event');
var Q = require('q');
var aws = require('aws-sdk');
var cloudfront = new aws.CloudFront();
exports.handler = function (event, context) {
//_log('Received event: ', event);
var bucket = event.Records[0].s3.bucket.name;
@Trapsta
Trapsta / gist:fa37e581561b570c29192bc7fe80d593
Created December 11, 2018 09:11 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@Trapsta
Trapsta / LICENSE.txt
Created October 30, 2018 17:14 — forked from jed/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Trapsta
Trapsta / gist_ban_file
Last active October 12, 2018 11:42
Todo
Implement SEO tweaks