Skip to content

Instantly share code, notes, and snippets.

View Kif11's full-sized avatar
🐁
Expanding digital frontier

Kirill Kovalevskiy Kif11

🐁
Expanding digital frontier
View GitHub Profile
@jhorikawa
jhorikawa / gaussianblur2d.c
Created February 19, 2020 19:45
2D Gaussian Blur for Houdini using VEX
float sigma = chf("sigma");
int res = chi("res");
int resx = chi("resx");
int resy = chi("resy");
int resn = floor(res / 2.0);
float weightTotal = 0;
float valTotal = 0;
for(int i=-resn; i<=resn; i++){
for(int n=-resn; n<=resn; n++){
float ix = @ptnum % resx + i;
@sneha-belkhale
sneha-belkhale / Fbm.cginc
Last active March 13, 2023 13:13
Fractal Brownian Motion function to include in Unity Shader
float hash (float2 n)
{
return frac(sin(dot(n, float2(123.456789, 987.654321))) * 54321.9876 );
}
float noise(float2 p)
{
float2 i = floor(p);
float2 u = smoothstep(0.0, 1.0, frac(p));
float a = hash(i + float2(0,0));
@crucialfelix
crucialfelix / analytics.js
Last active November 30, 2022 19:05
Google Analytics for Next.js with next/router
/**
* analytics.js;
* Copyright 2019 Chris Sattinger
* MIT license - do as thou wilt
*
* This will send page views on route change to Google Analytics.
* Works with https://nextjs.org/ and https://github.com/fridays/next-routes
**/
import Router from "next/router";
# Full text search
[hendry@t480s 5xx]$ cat bugzilla.sh
aws --profile uneet-dev logs filter-log-events --log-group-name bugzilla --start-time $(date -d "-1 hour" +%s000) \
--filter-pattern '"apex/ping/v1.0"'
# (faster) Query on a JSON structured log
[hendry@t480s 5xx]$ cat alambda.sh
aws --profile uneet-demo logs filter-log-events --log-group-name "/aws/lambda/alambda_simple" --start-time $(date -d "-8
@peerreynders
peerreynders / from_pipe.ex
Last active March 29, 2023 18:36
Elixir port using named pipe with releasing script
defmodule FromPipe do
#
# Use a helper script "from_pipe_release" to
# release/request each line read from the
# named pipe - effectively implementing a
# crude backpressure mechanism
#
@pipe_name "/tmp/testpipe"
@from_pipe_release "./from_pipe_release"
@from_pipe_clean "./from_pipe_clean"
@krisleech
krisleech / renew-gpgkey.md
Last active April 17, 2024 23:41
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date:

@jlis
jlis / .gitlab-ci.yml
Created May 15, 2018 13:16
AWS ECS and ECR deployment via Docker and Gitlab CI
image: docker:latest
variables:
REPOSITORY_URL: <AWS ACCOUNT ID>.dkr.ecr.eu-central-1.amazonaws.com/<ECS REPOSITORY NAME>
REGION: eu-central-1
TASK_DEFINTION_NAME: <TASK DEFINITION NAME>
CLUSTER_NAME: <CLUSTER NAME>
SERVICE_NAME: <SERVICE NAME>
services:
@shortjared
shortjared / list.txt
Last active April 19, 2024 10:41
List of AWS Service Principals
a4b.amazonaws.com
access-analyzer.amazonaws.com
account.amazonaws.com
acm-pca.amazonaws.com
acm.amazonaws.com
airflow-env.amazonaws.com
airflow.amazonaws.com
alexa-appkit.amazon.com
alexa-connectedhome.amazon.com
amazonmq.amazonaws.com
@subfuzion
subfuzion / dep.md
Last active June 14, 2023 15:46
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

@mwgkgk
mwgkgk / iex_connect.mkd
Last active April 19, 2023 03:06
Connect two IEx nodes

tl;dr:

$ iex --sname server
$ iex --sname client
iex(client@localhost)> Node.connect :"server@localhost"

Start a named node:

$ iex --name any_name@any_domain