Skip to content

Instantly share code, notes, and snippets.

= (λx.x x)(λx.x x)

Nathan Lilienthal nixpulvis

= (λx.x x)(λx.x x)
Block or report user

Report or block nixpulvis

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
nixpulvis / triangle.scss
Created Jan 30, 2014
Make some pretty triangles.
View triangle.scss
@mixin triangle($size, $color, $direction) {
width: 0;
height: 0;
@if $direction == 'up' {
border-left: $size solid transparent;
border-right: $size solid transparent;
border-bottom: $size solid $color;
} @elseif $direction == 'down' {
border-left: $size solid transparent;
nixpulvis / exceptions.rb
Created Feb 19, 2014
Add pundit authorization to Rails exception logic.
View exceptions.rb
module ActionDispatch
class ExceptionWrapper
@@rescue_responses.merge!('Pundit::NotAuthorizedError' => :forbidden)
View palindate.rb
require 'date'
def palindate?(date)
padded_month = "%02d" % date.month
padded_day = "%02d" %
both_pad = "#{padded_month}#{padded_day}#{date.year}"
month_pad = "#{padded_month}#{}#{date.year}"
day_pad = "#{date.month}#{padded_day}#{date.year}"
nixpulvis / simple_cookie_session.rb
Last active Aug 29, 2015
Simplistic Cookie Session
View simple_cookie_session.rb
nixpulvis / contiguous_2d_matrix.c
Last active Aug 29, 2015
Contiguous 2D Matrix C99
View contiguous_2d_matrix.c
int main(int argc, char **argv) {
size_t rows = atoi(argv[1]);
size_t columns = atoi(argv[2]);
/* This is really cool!!! */
int (*matrix)[columns] = malloc(sizeof(*matrix) * rows);
if (matrix) {
matrix[0][0] = 13;
matrix[1][0] = 1;
nixpulvis / cfg.rb
Last active Aug 29, 2015
Scalar register propagation.
View cfg.rb
require 'pp'
class BasicBlock
include Enumerable
attr_accessor :instructions, :children
def initialize(&block)
@instructions = []
@children = []
nixpulvis / unused_define.rb
Created Aug 18, 2014
Simple unused #define finder.
View unused_define.rb
#!/usr/bin/env ruby
require 'pp'
if ARGV[0]
# Collect defines.
defines = {}
Dir.glob("#{ARGV[0]}/**/*.{c,h}") do |path|, "r") do |file|
View lambda_fib.rkt
;; Credit Eli Barzilay
x)(λ(x y)y)
)(λ(x y)x))(
x(λ(x)(λ(x y)
y))(λ(x y
View macro.rkt
;; A macro that defines a PDA language
(define-syntax pushdown
(syntax-rules (: ->)
[(pushdown init-state end-state
[state : (input-stream input-stack -> new-state new-stack) ...]
(lambda (string)
(: state : (Listof Token) (Listof Token) -> Boolean)
(define (state stream stack)
View nixpulvis.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
You can’t perform that action at this time.