Skip to content

Instantly share code, notes, and snippets.

View praisegeek's full-sized avatar

Praise-God Emerenini praisegeek

View GitHub Profile
AWSTemplateFormatVersion: "2010-09-09"
Description: >
Launch a static website backed by an S3 bucket and served via https through cloudfront.
Assumes you have the following available already
* An address in mind (e.g. blog.example.com)
* An existing Route53 Hosted Zone for the domain
* A validated AWS ACM certificate arn for the desired web address which must be in eu-west-1
Parameters:
HostedZoneID:
Description: >
@praisegeek
praisegeek / osx-random-string.txt
Created January 29, 2021 19:49 — forked from rkasigi/osx-random-string.txt
OSX Generate Random String
openssl rand -base64 6
openssl rand -hex 4
openssl rand -base64 8 | md5 | head -c8;echo
openssl rand -base64 6
ping -c 1 yahoo.com |md5 | head -c8; echo
@praisegeek
praisegeek / clearTable.sh
Created June 18, 2020 12:27 — forked from pushplay/clearTable.sh
Delete all items (clear) in a DynamoDB table using bash
#!/bin/bash
TABLE_NAME=TableName
KEY=id
aws dynamodb scan --table-name $TABLE_NAME --attributes-to-get "id" --query "Items[].id.S" --output text | tr "\t" "\n" | xargs -t -I keyvalue aws dynamodb delete-item --table-name $TABLE_NAME --key '{"id": {"S": "keyvalue"}}'
import 'package:flutter/material.dart';
class AnimatedCount extends ImplicitlyAnimatedWidget {
AnimatedCount({
Key key,
@required this.count,
@required Duration duration,
Curve curve = Curves.linear,
}) : super(duration: duration, curve: curve, key: key);
@praisegeek
praisegeek / hlsdump.js
Created January 9, 2020 13:03 — forked from astro/hlsdump.js
Reliably record an HTTP Live Stream with node.js
var fs = require('fs');
var request = require('request');
var joinUrl = require('url').resolve;
if (process.argv.length != 3) {
console.log("Please pass playlist URL");
process.exit(1);
}
var plsUrl = process.argv[2];
var INTERVAL = 5 * 1000;
@praisegeek
praisegeek / 404.js
Created January 9, 2020 13:02
Gatsby error page which prevents a flash of 404
import React from "react";
import SEO from "../components/seo";
const browser = typeof window !== "undefined" && window;
const NotFoundPage = () => {
return (
browser && (
<div>
<SEO title="404 Page not found" />
@praisegeek
praisegeek / Velocity.json
Created July 2, 2019 11:13
Velocity Snippets for VSCode.
{
"Get Item By Id": {
"prefix": "GetItem",
"body": [
"{",
" \"version\": \"2017-02-28\",",
" \"operation\": \"GetItem\",",
" \"key\": {",
" \"id\": \\$util.dynamodb.toDynamoDBJson(\\$ctx.args.id),",
" }",
@praisegeek
praisegeek / iterm2-solarized.md
Created October 23, 2018 01:26 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@praisegeek
praisegeek / baseModel.php
Created August 6, 2018 15:57 — forked from nurrony/baseModel.php
#laravel #php A query scope for sorting and searching/filtering
<?php
/**
* Use this query scope from any model/controller
* It works on single table only, so for joined columns, make a mysql view and operate on that
* Example request fromat
*/
/*
[
'query' => [
@praisegeek
praisegeek / .zshrc
Created June 14, 2018 15:28
My ZSH dot file
alias nodejs=node
export TERM="xterm-256color"
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/root/.oh-my-zsh"
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.