Skip to content

Instantly share code, notes, and snippets.

View codecop's full-sized avatar

Peter Kofler codecop

View GitHub Profile
@FedericoPonzi
FedericoPonzi / not_expected_to_understand_this.md
Created December 18, 2016 11:38
Line 2238 Unix V6 Comment: You are not expected to understand this.

Here is the famous line 2238 of Unix V6 which is part of some of the most delicate parts of the kernel, context switching.

This comment received huge publicity and just may be the the most famous source code comment in computing history.

2230	/*
2231	 * If the new process paused because it was
2232	 * swapped out, set the stack level to the last call
3333	 * to savu(u_ssav).  This means that the return
2235	 * actually returns from the last routine which did

2236 * the savu.

package com.spun.triangles.test;
import static org.junit.Assert.assertEquals;
import java.util.Random;
import org.junit.Test;
/**
* Theory based kata
@jonelf
jonelf / random_fizzbuzz.rb
Last active October 3, 2017 21:32
A "random" FizzBuzz in Ruby. This is just for fun.
c = ('a'..'z').to_a
srand(1792579 * 1800)
f = (0..3).map { c[rand(26)] }
b = (0..3).map { c[rand(26)] }
a = [f, b].map {|s| s.join.capitalize }
srand(s = 93113 * 19243)
puts (0..99).map{|i| [a[0], a[0] + a[(srand(s) if i%15 < 1) || 1].to_s, a[1], i+1][rand(4)] }
@lyuboraykov
lyuboraykov / printjenkins.groovy
Last active February 8, 2024 10:24
Print to console in Jenkins Groovy system script
def out
def config = new HashMap()
def bindings = getBinding()
config.putAll(bindings.getVariables())
out = config['out']
out.println "Printed do Jenkins console."