Skip to content

Instantly share code, notes, and snippets.

@killercup
killercup / test.rs
Created April 6, 2015 18:20
Perlin noise benchmark: Updated Rust version -- compiles with rustc 1.0.0-nightly (be9bd7c93 2015-04-05) (built 2015-04-05)
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
fn main() {
use std::collections::HashMap;
// type inference lets us omit an explicit type signature (which
// would be `HashMap<&str, &str>` in this example).
let mut book_reviews = HashMap::new();
// review some books.
book_reviews.insert("Adventures of Huckleberry Finn", "My favorite book.");
book_reviews.insert("Grimms' Fairy Tales", "Masterpiece.");
@killercup
killercup / Makefile
Created July 15, 2015 13:26
Pandoc Removes Significant Spaces from CSS
html:
pandoc --self-contained \
--css=pandoc.css --to=html5 \
--output=rendered.html Readme.md
@killercup
killercup / Readme.md
Created August 13, 2015 07:53
Short and sweet fish prompt.

Fish prompt config

Looks like this:

1__fish___users_pascal_projekte_tools_rust_src_doc_trpl__fish_

/**
* ## Build Tasks
*/
var path = require('path');
var gulp = require('gulp');
var del = require('del');
var concat = require('gulp-concat');
var sourcemaps = require('gulp-sourcemaps');
var sass = require('gulp-sass');
// part of my admin.js. requires jquery. to use it, just call the function.
// got the idea from: http://www.mahner.org/weblog/spass-mit-newforms-admin-automatische-felder/
function authorselection() {
/* If there is an author field, and it is set to a user, hide the selection
* and let the user have to click on "change" to change it. This takes one
* decision to make form the user, but keeps functionality.
*/
if (!($("div#content-main select[name='author'] option[@selected]").text() == "---------")) {
// $("div#content-main select[name='author']").hide();
<?php // $thumburl ist die URL des Bildes bei Flickr (1024er Version normalerweise)
$thumburl = get_post_meta($post->ID, 'thumbnail', true);
// Aus $thumbname und $upload_path setzt sich der absolute Pfad der Datei zusammen
$thumbname = "thumbnails/".$post->ID."-800.jpg";
$upload_path = ABSPATH.get_option("upload_path");
// Sofern es die Datei noch nicht gibt, erstellen wir sie mal eben
if(!file_exists($upload_path."/".$thumbname)) {
// Datei von Flickr temporär laden
def quer(zahl):
qsumme = 0
for einer in str(zahl):
qsumme = qsumme + int(einer)
if len(str(qsumme)) > 1:
qsumme = quer(qsumme)
return qsumme
zahl = 4242
quersumme = quer(zahl)
/*!
* Hyphenator 2.4.0 - client side hyphenation for webbrowsers
* Copyright (C) 2009 Mathias Nater, Zürich (mathias at mnn dot ch)
* Project and Source hosted on http://code.google.com/p/hyphenator/
*
* This JavaScript code is free software: you can redistribute
* it and/or modify it under the terms of the GNU Lesser
* General Public License (GNU LGPL) as published by the Free Software
* Foundation, either version 3 of the License, or (at your option)
* any later version. The code is distributed WITHOUT ANY WARRANTY;