Skip to content

Instantly share code, notes, and snippets.

View pusewicz's full-sized avatar

Piotr Usewicz pusewicz

View GitHub Profile
@jdah
jdah / wfc.hpp
Created August 5, 2022 15:18
Wave Function Collapse
#pragma once
#include "util/types.hpp"
#include "util/std.hpp"
#include "util/ndarray.hpp"
#include "util/collections.hpp"
#include "util/rand.hpp"
#include "util/hash.hpp"
#include "util/assert.hpp"
#include "util/bitset.hpp"
@arunoda
arunoda / gist:7790979
Last active February 16, 2024 14:05
Installing SSHPass

Installing SSHPASS

SSHPass is a tiny utility, which allows you to provide the ssh password without using the prompt. This will very helpful for scripting. SSHPass is not good to use in multi-user environment. If you use SSHPass on your development machine, it don't do anything evil.

Installing on Ubuntu

apt-get install sshpass

Installing on OS X

@KELiON
KELiON / fish_prompt.fish
Last active September 17, 2021 21:11
Fish-fish shell prompt with ruby version and git info
function _git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _is_git_dirty
echo (git status -s --ignore-submodules=dirty ^/dev/null)
end
function _rb_prompt
echo (rbenv version | awk '{print $1}')
@wjlroe
wjlroe / README.md
Created August 13, 2012 10:20
How to serve static files with POW

Problem

You wanna serve up static files, but are bored by the usual trick of:

python -m SimpleHTTPServer

This is pretty simple but why type this every time? Let's use Pow for some zero-effort web serving. If you have Pow already set up, then just drop the provided config.ru file into the root of your static files. Then link your directory into ~/.pow so Pow can see it and that's it!

Let's say you have a directory with mockups you wanna show people, they are in ~/Dropbox/Mockups/ then you might do this:

#!/usr/bin/env ruby
# Rulog - Ruby Syslog Server
# Captures syslog events and spits them out to Growl.app
# Useful for on-spot debugging of a device with remote syslog support
# Blocking IO
# Run as root
require 'socket'
import re
# http://atomboy.isa-geek.com/plone/Members/acoil/programing/double-metaphone
from metaphone import dm as double_metaphone
# get the Redis connection
from jellybean.core import redis
import models
# Words which should not be indexed
@zaphar
zaphar / date_util.erl
Created May 1, 2009 06:07
set of utility functions that wrap the calendar module and erlangs now() date() and time() functions
-module(date_util).
-compile(export_all).
epoch() ->
now_to_seconds(now())
.
epoch_hires() ->
now_to_seconds_hires(now())
.