Skip to content

Instantly share code, notes, and snippets.

@swyxio
swyxio / readme.md
Last active January 16, 2022 10:36
svelte society day talks and resources -
@mbleigh
mbleigh / README.md
Last active June 25, 2025 18:44
Firebase Hosting Fetch All Files

Fetch All Files from Firebase Hosting

This script fetches all of the files from the currently deployed version of a Firebase Hosting site. You must be signed in via the Firebase CLI and have "Site Viewer" permission on the site in question to be able to properly run the script.

Running via NPX

npx https://gist.github.com/mbleigh/9c8680cf319ace2f506f57380da66e7d <site_name>
@slightfoot
slightfoot / page_turn.dart
Created September 9, 2019 21:28
Page Turn Effect - By Simon Lightfoot. Replicating this behaviour. https://www.youtube.com/watch?v=JqvtZwIJMLo
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
curl -i -X PUT -H "Content-Type:application/json" \
http://localhost:8083/connectors/sink-elastic-orders-00/config \
-d '{
"connector.class": "io.confluent.connect.elasticsearch.ElasticsearchSinkConnector",
"topics": "orders",
"connection.url": "http://elasticsearch:9200",
"type.name": "type.name=kafkaconnect",
"key.ignore": "true",
"schema.ignore": "false",
"errors.tolerance":"all",
@everesio
everesio / aws.tf
Last active April 29, 2024 02:37
kafka-proxy with Amazon MKS
provider "aws" {
region = "us-east-1"
}
data "aws_caller_identity" "current" {}
data "aws_vpc" "vpc" {
filter {
name = "tag:Name"
values = [
@HackingGate
HackingGate / restore_last_git_modified_time.sh
Last active February 9, 2025 03:00
Retrieve and set the last modification date of all files in a git repository. Solution for https://stackoverflow.com/a/55609950/4063462
#!/bin/sh -e
OS=${OS:-`uname`}
if [ "$OS" = 'Darwin' ]; then
get_touch_time() {
date -r ${unixtime} +'%Y%m%d%H%M.%S'
}
else
# default Linux
for %%f in (*.ts) do (
ffmpeg -i "%%f" -c:v h264_nvenc -c:a copy "%%f.mp4"
)
pause
@puf
puf / README.md
Last active March 28, 2023 16:37
Firebase Hosting Deploy Single File

This script may no longer work. Have a look at its (more official) replacement: https://github.com/firebase/firebase-tools/tree/master/scripts/examples/hosting/update-single-file

Firebase Hosting Deploy Single File

This utility script deploy a single local file to an existing Firebase Hosting site. Other files that are already deployed are left unmodified.

The difference with firebase deploy is that this script does not require you to have a local snapshot of all hosted files, you just need the one file that you want to add/update.

@mattyb149
mattyb149 / SequenceLookupExample.xml
Created August 22, 2018 15:14
A NiFi template with a ScriptedLookupService that retrieves a sequence number from an external database
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<template encoding-version="1.2">
<description>This template gives an example of using a ScriptedLookupService to provide sequence numbers from a database.</description>
<groupId>5d7e55f8-0165-1000-1170-d42741815ddb</groupId>
<name>SequenceLookupExample</name>
<snippet>
<connections>
<id>0cf6aae2-8e5a-361f-0000-000000000000</id>
<parentGroupId>cedd92a0-903e-3f68-0000-000000000000</parentGroupId>
<backPressureDataSizeThreshold>1 GB</backPressureDataSizeThreshold>

Got Retweets?

Even though Twitter's statuses/retweets API endpoint is limited to the last 100 retweets it is possible to use the search/tweets endpoint to search for the retweets using the text of the tweet. Caveat: This is only possible for tweets that have happened in the last 7 days, which is furthest back Twitter allow you to search for tweets in.

For example here is how you can get the retweets for this tweet and analyze the users in a spreadsheet.