Skip to content

Instantly share code, notes, and snippets.

View kot-behemoth's full-sized avatar

Greg Goltsov kot-behemoth

View GitHub Profile
@kot-behemoth
kot-behemoth / photos_tag.rb
Created August 18, 2012 13:35 — forked from sukima/photos_tag.rb
Jekyll Plugin for easy FancyBox usage
# Title: Photos tag for Jekyll
# Authors: Devin Weaver
# Description: Allows photos tag to place photos as thumbnails and open in fancybox. Uses a CDN if needed.
#
# ** This only covers the markup. Not the integration of FancyBox **
#
# To see an unabridged explination on integrating this with [FancyBox][1]
# Please read my [blog post about it][2].
#
# [1]: http://fancyapps.com/fancybox/
@kot-behemoth
kot-behemoth / UIViewControllerModalPush.h
Created October 13, 2012 18:14
Modal push for UIViewController
#import <UIKit/UIKit.h>
@interface UIViewController (ModalPush)
- (void)pushViewControllerFromModal:(UIViewController *)VC animated:(BOOL)animated;
@end
@kot-behemoth
kot-behemoth / SpriteGluer.rb
Created October 26, 2012 22:03
SpriteGluer
# Usage:
# Place the script in the directory with all the images, tweak `prefix` and `output` and just run it.
require 'rubygems'
require 'RMagick'
include Magick
Image_dims = 96
prefix = 'swordskel attack'
output = 'p_dying'
@kot-behemoth
kot-behemoth / Example.cs
Created November 2, 2012 15:02
LinkBatch
using System;
using Microsoft.Xna.Framework;
namespace LineBatch
{
public class LineBatchTest : Game
{
GraphicsDeviceManager graphics;
LineBatch lineBatch;
@kot-behemoth
kot-behemoth / latex.template
Created December 10, 2012 21:14 — forked from bosmacs/latex.template
Simple Pandoc latex.template with comments
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.
# elementary arrays I'll use to define directions
pos = [i for i in range(4)]
neg = [-i for i in pos]
zer = [0]*4
# First, compute the direction vectors. Given a coordinate and a direction vector,
# we can generate four coordinates in a desired direction. We'll care about 8 directions.
# Even though left/right, and up/down are the same, let's no worry about that for now.
# 1 2 3
# \ | /
### Keybase proof
I hereby claim:
* I am kot-behemoth on github.
* I am gregoltsov (https://keybase.io/gregoltsov) on keybase.
* I have a public key ASAc_OJ-I8wpcOfOOTlG9C2S-3rKcwupAMyR4s4A_MW7sQo
To claim this, I am signing this object:
import itertools
from ipaddress import ip_address
all_ips_tuples = itertools.product(range(256), repeat=4)
# these are generators, meaning they don't store all values in memory
ip_strings = ('.'.join(map(str, ip_tuple))
for ip_tuple in all_ips_tuples)
ip_objects = (ip_address(ip_string)
for ip_string in ip_strings)
@kot-behemoth
kot-behemoth / aabill.md
Last active December 21, 2018 11:55
How to help against AABill

How to help again AABil

Social media is great for raising awareness but insufficient to create change in legislation. We encourage you to reach out directly if this issue matters to you.

  • Australians: Contact your MP, on behalf of yourself, or your company (if you have the authority to do so). The EFA has a step-by-step guide on how to find out who your representative is, and the best way to get a result.
  • Educate your friends, your colleagues, your family and ask them to also talk to their MPs.
  • Australians and others: Submit a letter to the PJCIS by the end of March 2019. The inquiry is there to record concerns from anyone affected by the bill. Don’t hold off submitting because you think someone else will do it, or because you’re not sure what to say. Every entry helps our lawmakers see the breadth and depth of the impact of the new law.
  • If you’re not an Australian, be aware that the appetite for this type of law is not limited to Australia. Stay informed and engaged with this topic in your part of