Skip to content

Instantly share code, notes, and snippets.

View oneEyedSunday's full-sized avatar
🤙
Working from home

Idiakose O. Sunday oneEyedSunday

🤙
Working from home
View GitHub Profile
@gileri
gileri / cwl.py
Last active February 28, 2023 04:15
Cloudwatch logs length test
#!/bin/env python3
from time import time, sleep
import boto3
LOG_STREAM = str(int(time()))
LOG_GROUP = "CHANGEME"
cwl = boto3.client("logs")
class UberQueue<T>
{
private IAsyncQueue<T>[] _queues;
private Task<T>[] _tasks;
public UberQueue(IAsyncQueue<T>[] queues)
{
_queues = queues;
}
@skidoodle
skidoodle / vpn.md
Last active December 31, 2023 01:40
VPN

You're probably reading this because you've asked what VPN service to use, and this is the answer.

@Akamaozu
Akamaozu / log_parser.js
Last active August 1, 2020 22:33
node.js streaming log parser
var chunks_received = 0,
lines_parsed = 0,
server_logs = [],
started = Date.now();
process.stdin.on( 'readable', function(){
var received_buffer = process.stdin.read();
if( ! received_buffer ) return;
chunks_received += 1;
@amiantos
amiantos / index.js
Last active June 12, 2024 16:45
Zip Multiple Files from S3 using AWS Lambda Function
// Lambda S3 Zipper
// http://amiantos.net/zip-multiple-files-on-aws-s3/
//
// Accepts a bundle of data in the format...
// {
// "bucket": "your-bucket",
// "destination_key": "zips/test.zip",
// "files": [
// {
// "uri": "...", (options: S3 file key or URL)
@trung
trung / notify.yml
Last active May 15, 2024 13:03
Notify slack about Github Actions workflow and its jobs status. `notify` job must be the last job in the workflow and it must depend on all other jobs
notify:
if: always()
name: Notify
needs:
- job1
- job2
- job11
- job3
- job4
runs-on: ubuntu-latest
@radiumrasheed
radiumrasheed / angular-s3-redirect.xml
Last active February 26, 2020 17:36
angular s3 redirect rule
<RoutingRules>
<RoutingRule>
<Condition>
<HttpErrorCodeReturnedEquals>404</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<ReplaceKeyPrefixWith>#/</ReplaceKeyPrefixWith>
<HttpRedirectCode>302</HttpRedirectCode>
</Redirect>
</RoutingRule>
emitValue(observer) {
let i = 0;
const id = setInterval(() => {
observer.next(i++)
}, 1000)
return () => { clearInterval(id) }
}
createObservable(emitValueFn) {
return {
@mrcleanandfresh
mrcleanandfresh / super-list-infinite.tsx
Last active May 17, 2021 16:53
React Virtualized Infinite loader with List example using React Hooks
import faker from 'faker';
import _ from 'lodash';
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { Col, Row } from 'react-bootstrap';
import { AutoSizer, IndexRange, InfiniteLoader, List, ListRowProps } from 'react-virtualized';
import wait from 'waait';
import { SuperProps } from './super-props';
export interface SuperListProps {
/**
@oneEyedSunday
oneEyedSunday / Joins.sql
Created May 11, 2019 19:31
Mysql re-up
-- delete a customer
-- bcos of constraint
-- first turn off foreign_key_checks
SET foreign_key_checks = 0;
-- dorp customer(s)
SET foreign_key_checks = 1;
-- INNER JOIN
-- fetch details of customers and orders they made
-- wont show details of orders of customer 11