Skip to content

Instantly share code, notes, and snippets.

@zloedi
zloedi / roguelike_FOV.c
Last active January 11, 2024 07:17
Efficient roguelike grid FOV / shadowcasting / line of sight in a single C function inspired by https://docs.microsoft.com/en-us/archive/blogs/ericlippert/shadowcasting-in-c-part-one
// Copyright (c) 2021 Stoiko Todorov
// This work is licensed under the terms of the MIT license.
// For a copy, see https://opensource.org/licenses/MIT.
// What this function does:
// Rasterizes a single Field Of View octant on a grid, similar to the way
// field of view / line of sight / shadowcasting is implemented in some
// roguelikes.
// Uses rays to define visible volumes instead of tracing lines from origin
// to pixels.
@joeblau
joeblau / git yolo
Created February 3, 2014 12:48
git yolo command
alias gityolo='git commit -am "DEAL WITH IT" && git push -f origin master'
@justinmayer
justinmayer / Menlo-for-Powerline.zip
Last active November 18, 2021 17:45
Menlo font, patched for Powerline. Includes regular, bold, italic, and bold italic variants.
@jtadeulopes
jtadeulopes / server.md
Last active March 29, 2024 10:23
Server setup with ubuntu, nginx and puma for rails app.

Update and upgrade the system

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo reboot

Configure timezone

@linjunpop
linjunpop / deploy-rails-4-app-with-dokku-on-digital-ocean.md
Last active May 30, 2023 08:20
Deploy Rails 4 app with Dokku on DigitalOcean

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
@inopinatus
inopinatus / hstore_accessor.rb
Last active February 22, 2019 08:32
hstore accessor class method for AR
# include from an initializer
module HstoreAccessor
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def hstore_accessor(hstore_attribute, *keys)
Array(keys).flatten.each do |key|
@johnrees
johnrees / opacity_mixin.css.scss
Created May 2, 2012 11:26
SASS/SCSS Internet Explorer Compatible Opacity Mixin
@mixin opacity($alpha) {
// IE 8
-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=$alpha*100)";
// IE 5-7
filter: alpha(opacity=$alpha*100);
// Real Browsers
-webkit-opacity: $alpha;
-moz-opacity: $alpha;
-khtml-opacity: $alpha;
opacity: $alpha;
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@johnrees
johnrees / _ubuntu_steps.sh
Last active November 29, 2021 01:42
Standard Rails 5.* setup for Ubuntu 14.04 LTS
# As root user
sudo su
# Update the OS
sudo apt-get update -y
# Add this to ~/.bashrc to remove timezone warnings
echo 'export LC_ALL="en_US.UTF-8"' >> ~/.bashrc
source ~/.bashrc
@panuta
panuta / gist:1852087
Last active April 8, 2020 16:46
How to setup Django/Postgresql on OS X Mountain Lion using Homebrew

Command Line Tools for Xcode

Command line tools comes bundle with Xcode prior to 4.3 version. After 4.3, you need to install a separated command line tools yourself.

First, go to this url and login using Apple Developer account (Free to register)

https://developer.apple.com/downloads/index.action