Skip to content

Instantly share code, notes, and snippets.

View sansmoraxz's full-sized avatar
🗺️
Optimizing mana flows

Souyama sansmoraxz

🗺️
Optimizing mana flows
View GitHub Profile
@sansmoraxz
sansmoraxz / sgdr.py
Created September 30, 2018 14:26 — forked from jeremyjordan/sgdr.py
Keras Callback for implementing Stochastic Gradient Descent with Restarts
from keras.callbacks import Callback
import keras.backend as K
import numpy as np
class SGDRScheduler(Callback):
'''Cosine annealing learning rate scheduler with periodic restarts.
# Usage
```python
schedule = SGDRScheduler(min_lr=1e-5,
@sansmoraxz
sansmoraxz / tts.js
Created December 17, 2020 20:27
Text to speech browser api
const textToSpeech = "Your speech"
let synUtterance = new SpeechSynthesisUtterance(textToSpeech);
/*
// settimeout unless it changes to use promise
[synUtterance.voice, _] = settimeout(
() => speechSynthesis.getVoices(),
2000);
synUtterance.rate = 1; // default
synUtterance.
@sansmoraxz
sansmoraxz / register_oracle_jdk.sh
Last active October 6, 2021 18:24
Use Oracle JDK in Ubuntu
#!/bin/bash
#user inputs java path
if [[ $1 ]]
then
JAVA_PATH="$1/bin"
# use JAVA_HOME environment variable
elif [[ $JAVA_HOME ]]
then
@sansmoraxz
sansmoraxz / settings.jsonc
Last active February 8, 2021 20:22
Windows Terminal Executables List
"list": [
{
// Make changes here to the powershell.exe profile.
"guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
"name": "Windows PowerShell",
"colorScheme": "UnderTheSea",
"tabColor": "#011116",
"commandline": "powershell.exe",
"hidden": false
},
@sansmoraxz
sansmoraxz / generate_random_data.ipynb
Last active August 19, 2022 14:32
Generate_Random_Data.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sansmoraxz
sansmoraxz / multiFetchJSON.py
Last active June 7, 2022 18:09
Fetch JSON data from URLs (async) and store in container - python
# Install required libraries tqdm, aiohttp
# from tqdm import tqdm
# import aiohttp
import typing
async def multiFetchJSON(indices,
container: dict = {},
urlFormat: str = '',
@sansmoraxz
sansmoraxz / kube-schema.json
Created August 9, 2022 14:49
Kubernetes schema
{
"type": "object",
"anyOf": [
{
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master-local/_definitions.json"
},
{
"$ref": "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/master-local/affinity-v1.json"
},
{
@sansmoraxz
sansmoraxz / settings.json
Created September 5, 2022 10:32
VSCode settings for AWS cloudformation
{
"yaml.schemas": {
"https://raw.githubusercontent.com/awslabs/goformation/master/schema/cloudformation.schema.json": "cloudformations/*-cloudformation.yaml"
},
// Custom tags for the parser to use
"yaml.customTags": [
"!Equals sequence",
"!FindInMap sequence",
"!GetAtt",
"!GetAZs",
@sansmoraxz
sansmoraxz / spec.yaml
Last active March 26, 2023 09:33
Gotoscrap- api spec
# Srapping Spec
template-version: v0.0.1
parameters:
- name: num
value: 1
request:
method: POST
url:
@sansmoraxz
sansmoraxz / fix-keda-warn-log-kubectl.yaml
Last active May 2, 2023 11:31
Stops the shit spamming from Keda
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: dummy-scaledobject
spec:
scaleTargetRef:
name: dummy-deployment
triggers:
- type: cron
metadata: