Skip to content

Instantly share code, notes, and snippets.

View Tombarr's full-sized avatar
:octocat:
Coding

Tom Barrasso Tombarr

:octocat:
Coding
View GitHub Profile
@Tombarr
Tombarr / InfiniteScroll.svelte
Created May 1, 2023 22:04
Infinite scroll Svelte component that appends DOM elements in increments of page sizes as the user scrolls beyond a threshold
<!--
InfiniteScroll.svelte
Author: Tom Barrasso
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
@chris
chris / apigateway-dynamo_serverless.yml
Last active December 17, 2021 05:14
Serverless Framework config file for creating API Gateway to DynamoDB proxy
service: my-api
org: CompanyName
# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
# frameworkVersion: "=X.X.X"
frameworkVersion: '>=2.1.1 <3.0.0'
custom:
defaultStage: dev
@samfellow
samfellow / IPTV-big-list.m3u
Created February 18, 2020 03:17 — forked from skypce/IPTV-big-list.m3u
IPTV big list.m3u
#EXTM3U
#EXTINF:-1,TELEMUNDO
http://iphone-streaming.ustream.tv/ustreamVideo/21733416/streams/live/playlist.m3u8
#EXTINF:0,TELEMUNDO
http://iphone-streaming.ustream.tv/ustreamVideo/21733416/streams/live/playlist.m3u8
#EXTINF:-1,UNIVISION
http://iphone-streaming.ustream.tv/ustreamVideo/21680354/streams/live/playlist.m3u8
#EXTINF:0,UNIVISION 1
@callum-p
callum-p / logstash-cloudwatch.yml
Last active August 24, 2021 21:31
Deploys lambda functions to forward cloudwatch logs to logstash
Description: Deploys lambda functions to forward cloudwatch logs to logstash
Parameters:
coreNetworkingStackName:
Type: String
Resources:
lambdaRole:
Type: "AWS::IAM::Role"
Properties:
@AwsGeek
AwsGeek / handler.py
Last active January 10, 2021 18:45
Parse S3 logs and send to Google Analytics using the Google Analytics Measurement Protocol
from __future__ import print_function
import re
import urllib
import boto3
from botocore.vendored import requests
s3 = boto3.client('s3')
pattern = re.compile(r'(?P<owner>\S+) (?P<bucket>\S+) \[(?P<time>.*)\] (?P<ip>\S+) (?P<requester>\S+) (?P<reqid>\S+) (?P<operation>\S+) (?P<key>\S+) (?P<request>"[^"]*") (?P<status>\S+) (?P<error>\S+) (?P<bytes>\S+) (?P<size>\S+) (?P<totaltime>\S+) (?P<turnaround>\S+) (?P<referrer>"[^"]*") (?P<useragent>"[^"]*") (?P<version>\S)')
@securityMB
securityMB / scrollbar.md
Created February 24, 2018 23:21
Scrollbar

CSS Scrollbar attack

Image we have the following code:

<script>
var TOKEN="abcdef";
</script>
@Tombarr
Tombarr / input-reset.css
Last active January 8, 2025 22:06
CSS to remove input pseudo-elements and normalize input styling cross-browser
/* All of our custom controls should be what we expect them to be */
input,
textarea {
-webkit-box-sizing:content-box;
-moz-box-sizing:content-box;
box-sizing:content-box;
}
/*
Show overflow in Edge
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
//npm init -y
//npm install --save puppeteer
//usage: node script.js /path/to/input.html /path/to/output.pdf
//script.js
const puppeteer = require('puppeteer');
(async () => {
@bendc
bendc / raf-boilerplate.js
Created August 28, 2017 13:52
rAF tutorial: boilerplate code
"use strict";
// animation utils
// ===============
const trackTime = id => {
const [entry] = performance.getEntriesByName(id);
if (!entry) {
performance.mark(id);