Skip to content

Instantly share code, notes, and snippets.

View foxish's full-sized avatar
🎯
Focusing

Anirudh Ramanathan foxish

🎯
Focusing
View GitHub Profile
@mvsusp
mvsusp / predict.java
Last active January 27, 2022 22:09
How to make predictions against a SageMaker endpoint
package org.example.basicapp;
import com.amazonaws.services.sagemakerruntime.AmazonSageMakerRuntime;
import com.amazonaws.services.sagemakerruntime.AmazonSageMakerRuntimeClientBuilder;
import com.amazonaws.services.sagemakerruntime.model.InvokeEndpointRequest;
import com.amazonaws.services.sagemakerruntime.model.InvokeEndpointResult;
import java.nio.ByteBuffer;
public class App
@panta
panta / logging.go
Last active July 5, 2024 06:25
zerolog with file log rotation (lumberjack) and console output
package logging
import (
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"gopkg.in/natefinch/lumberjack.v2"
"os"
"path"
"io"
)
@W360S
W360S / Install Postgres and first login DB
Created March 13, 2018 06:25
Install Postgres and first login DB
Setting a password for the postgres user
On Linux systems, there is no default password set.
To set the default password:
Run the psql command from the postgres user account:
sudo -u postgres psql postgres
Set the password:
@elkozmon
elkozmon / zoonavigator.docker-compose.yml
Last active July 18, 2022 01:18
Docker compose file for ZooNavigator with Zookeeper
version: '2.1'
services:
web:
image: elkozmon/zoonavigator-web:latest
container_name: zoonavigator-web
ports:
- "8000:8000"
environment:
API_HOST: "api"
@enricofoltran
enricofoltran / main.go
Last active July 25, 2024 03:38
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@ahmetb
ahmetb / gcrgc.sh
Last active May 10, 2024 15:17
Script to clean up Google Container Registry images pushed before a particular date
#!/bin/bash
# Copyright © 2017 Google Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@sergiotapia
sergiotapia / md5-example.go
Last active December 5, 2023 03:53
Golang - How to hash a string using MD5.
import (
"crypto/md5"
"encoding/hex"
)
func GetMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}
@prwhite
prwhite / Makefile
Last active July 24, 2024 10:52
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@mtigas
mtigas / gist:952344
Last active June 20, 2024 11:22
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.


Updated Apr 5 2019:

because this is a gist from 2011 that people stumble into and maybe you should AES instead of 3DES in the year of our lord 2019.

some other notes:

/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {