Skip to content

Instantly share code, notes, and snippets.

View racinmat's full-sized avatar
🎨
Playing with Stable Diffusion in spare time.

Matěj Račinský racinmat

🎨
Playing with Stable Diffusion in spare time.
View GitHub Profile
@d11wtq
d11wtq / docker-ssh-forward.bash
Created January 29, 2014 23:32
How to SSH agent forward into a docker container
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
@jcppkkk
jcppkkk / gist:6409139
Last active September 30, 2023 15:49
Cookie clicker assistant (Bookmarklet) store the code as a bookmark, then click it when you are in Cookie clicker.
javascript: (function () {
function loadScript(b, c) {
var a = document.createElement("script");
a.type = "text/javascript";
if (a.readyState) {
a.onreadystatechange = function () {
if (a.readyState == "loaded" || a.readyState == "complete")
{a.onreadystatechange = null; c() } }
} else {a.onload = function () {c() } } a.src = b;
document.getElementsByTagName("head")[0].appendChild(a)
@aras-p
aras-p / preprocessor_fun.h
Last active April 12, 2024 17:24
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 15, 2024 21:45
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@larsmans
larsmans / hellinger.py
Created July 15, 2012 13:25
Hellinger distance for discrete probability distributions in Python
"""
Three ways of computing the Hellinger distance between two discrete
probability distributions using NumPy and SciPy.
"""
import numpy as np
from scipy.linalg import norm
from scipy.spatial.distance import euclidean
@webdestroya
webdestroya / RichardIsAFuckingIdiot.cs
Created January 4, 2012 01:27
RichardIsAFuckingIdiot
//Code sanitized to protect the foolish.
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Web.UI;
namespace Mobile.Web.Control
{
/// <summary>
@JanTvrdik
JanTvrdik / FormMacros.php
Created June 12, 2010 10:49 — forked from janmarek/FormMacros.php
Macros for manual form rendering in Nette Framework
<?php
namespace Nette\Templates;
use Nette;
use Nette\String;
use Nette\Forms\Form;
/**
* Form macros
*