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
@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
*
@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>
@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
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active April 23, 2024 19:14
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%'
@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,
@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)
@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
@pbugnion
pbugnion / ipython_notebook_in_git.md
Last active October 22, 2023 12:25
Keeping IPython notebooks under Git version control

This gist lets you keep IPython notebooks in git repositories. It tells git to ignore prompt numbers and program outputs when checking that a file has changed.

To use the script, follow the instructions given in the script's docstring.

For further details, read this blogpost.

The procedure outlined here is inspired by this answer on Stack Overflow.

@mostaphaRoudsari
mostaphaRoudsari / .block
Last active November 26, 2020 04:03
Parallel Coordinates with mouseover highlight and tooltip
license: mit
@yrevar
yrevar / imagenet1000_clsidx_to_labels.txt
Last active April 17, 2024 22:50
text: imagenet 1000 class idx to human readable labels (Fox, E., & Guestrin, C. (n.d.). Coursera Machine Learning Specialization.)
{0: 'tench, Tinca tinca',
1: 'goldfish, Carassius auratus',
2: 'great white shark, white shark, man-eater, man-eating shark, Carcharodon carcharias',
3: 'tiger shark, Galeocerdo cuvieri',
4: 'hammerhead, hammerhead shark',
5: 'electric ray, crampfish, numbfish, torpedo',
6: 'stingray',
7: 'cock',
8: 'hen',
9: 'ostrich, Struthio camelus',