Skip to content

Instantly share code, notes, and snippets.

View LuizPanariello's full-sized avatar

Luiz Panariello LuizPanariello

View GitHub Profile
@LuizPanariello
LuizPanariello / Localstorage.swift
Created September 15, 2023 15:28
Expirable UserDefaults for swift
class Localstorage {
static func setRecord(key: String, value: Any, duration: TimeInterval) {
let expirationDate = Date().addingTimeInterval(duration);
let expirationKey = key + "_expirable";
let dict = [
expirationKey: expirationDate,
key: value
]
UserDefaults.standard.set(dict, forKey: key);
@LuizPanariello
LuizPanariello / gist:1ac1a40786bace306038170a48a48f0b
Last active April 14, 2022 14:34
Cloudformation Topic to GoogleChat Webhook
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Alarms to GoogleChat'
Metadata:
AWS::CloudFormation::Interface:
ParameterGroups:
- Label:
default: General
Parameters:
- Environment
- Label:
<%
Class SeatItem
Private IndexVar
Private SeatVar
Private RemainderVar
public property get Index()
Index = IndexVar
end property
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js">
</script>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body ng-app="app">