Skip to content

Instantly share code, notes, and snippets.

View xsaamiir's full-sized avatar
🟡
xoē

sāmīr xsaamiir

🟡
xoē
View GitHub Profile
@lovromazgon
lovromazgon / README.md
Last active October 19, 2023 21:44
Schedule starting/stopping a CloudSQL instance on GCP

To use this cloud function follow these steps:

  1. Create a pub/sub topic which will be used to trigger the cloud function.
  2. Create the cloud function and copy in the code below.
    1. Make sure to set the correct project ID in line 8.
    2. Set the trigger to Pub/Sub and choose the topic created in step 1.
  3. Create a cloud scheduler job to trigger the cloud function on a regular basis.
    1. Choose the frequency when you want the cloud function to be triggered.
    2. Set the target to Pub/Sub and define the topic created in step 1.
    3. The payload should be set to start [CloudSQL instance name] or stop [CloudSQL instance name] to start or stop the specified instance (e.g. start my_cloudsql_instance will start the CloudSQL instance with the name my_cloudsql_instance)
import React from "react";
import { Link } from "react-router-dom";
export function createResource(getPromise) {
let cache = {};
let inflight = {};
let errors = {};
function load(key) {
inflight[key] = getPromise(key)
@markbates
markbates / github-workflows-goreleaser.yml
Last active March 7, 2020 09:00
Run Go tests in Windows, Mac, Linux. Go version 1.12/1.13 both with Modules and GOPATH.
name: Release
on:
release:
types:
- published
jobs:
release:
name: Release
runs-on: ubuntu-latest
#!/bin/bash
echo "removing evaluation key"
rm ~/.IntelliJIdea2017.3/config/eval/idea173.evaluation.key
echo "resetting evalsprt in options.xml"
sed -i '/evlsprt/d' ~/.IntelliJIdea2017.3/config/options/options.xml
echo "resetting evalsprt in prefs.xml"
sed -i '/evlsprt/d' ~/.java/.userPrefs/prefs.xml
{
"fantasy-name": "Restaurant fantasy name",
"company name": "Restaurant company name",
"logo": "Restaurant logo",
"CNPJ": "Restaurant CNPJ",
"phone": "Restaurant phone",
"telephone": "Restaurant telephone",
"website": "Restaurant website",
"category": [
"Fast Food",
package services
import java.security.Security
import org.slf4j.LoggerFactory
object DnsCache {
private val logger = LoggerFactory.getLogger("DnsCache")
@augbog
augbog / Free O'Reilly Books.md
Last active May 14, 2024 10:27
Free O'Reilly Books

Free O'Reilly books and convenient script to just download them.

Thanks /u/FallenAege/ and /u/ShPavel/ from this Reddit post

How to use:

  1. Take the download.sh file and put it into a directory where you want the files to be saved.
  2. cd into the directory and make sure that it has executable permissions (chmod +x download.sh should do it)
  3. Run ./download.sh and wee there it goes. Also if you do not want all the files, just simply comment the ones you do not want.
@matanox
matanox / Slick 3.0.0 code generation
Last active April 13, 2018 17:12
SBT task for slick code generation from a live database
//
// SBT task for slick code generation for a live database
// ======================================================
//
// This sbt task will generate slick scala classes to match your (MySQL) database schema,
// which will allow you to use the database through slick, in your scala application.
//
// Usage: Review all ? symbols and comments below, to adapt to your system. Embed in build.sbt.
// Make sure the database is up. Run: sbt slickGenerate
// In your scala application, import the resulting scala file
@bonzanini
bonzanini / create_index.sh
Last active May 25, 2023 23:35
Elasticsearch/Python test
curl -XPOST http://localhost:9200/test/articles/1 -d '{
"content": "The quick brown fox"
}'
curl -XPOST http://localhost:9200/test/articles/2 -d '{
"content": "What does the fox say?"
}'
curl -XPOST http://localhost:9200/test/articles/3 -d '{
"content": "The quick brown fox jumped over the lazy dog"
}'
curl -XPOST http://localhost:9200/test/articles/4 -d '{
@idleberg
idleberg / fish_shell.md
Last active June 11, 2024 00:49
Instructions on how to install Fish shell on Mac OS X, including Oh My Fish!. Also includes several useful functions.

Installation

  1. Install fish via Brew
  2. Optionally install Oh My Fish!
  3. Add fish to known shells
  4. Set default shell to fish
brew install fish  
curl -L https://get.oh-my.fish | fish