Skip to content

Instantly share code, notes, and snippets.

View halbkreativ's full-sized avatar
🎾

Christoph halbkreativ

🎾
View GitHub Profile
@halbkreativ
halbkreativ / Primes.swift
Created December 5, 2015 03:04
Primes in Apple's Swift
import Cocoa
import Foundation
func isPrime(n: Int) -> Bool {
if n < 2 {
return false // are not primes
}
let limit = Int(sqrt(Float(n)))
if limit < 2 {
return true // 2, 3 are primes
@halbkreativ
halbkreativ / TYPO3.xml
Created December 4, 2015 17:50
TYPO3 Code Styles für PhpStorm
<code_scheme name="TYPO3">
<option name="KEEP_BLANK_LINES_IN_DECLARATIONS" value="0" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<PHPCodeStyleSettings>
<option name="COMMA_AFTER_LAST_ARRAY_ELEMENT" value="true" />
<option name="PHPDOC_BLANK_LINE_BEFORE_TAGS" value="true" />
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
<option name="LOWER_CASE_NULL_CONST" value="true" />
<option name="KEEP_RPAREN_AND_LBRACE_ON_ONE_LINE" value="true" />
@halbkreativ
halbkreativ / OnDay.cs
Last active August 29, 2015 14:11
C# Coffee Mug
private void OnDay_Load(object sender, EventArgs e)
{
Beverage coffee = new Beverage(Sweetener.Sugar, Beverage.Milk);
coffee.Cream = true;
Cup mug = new Cup();
mug.Fill(coffee);
Me.Consume(mug);
mug.Dispose();
}