Skip to content

Instantly share code, notes, and snippets.

Compiling sdl2-sys v0.0.26 (https://github.com/AngryLawyer/rust-sdl2#a3f40ed0)
Running `rustc /home/norbert/.cargo/git/checkouts/rust-sdl2-8facfb557b6c1670/master/sdl2-sys/build.rs --crate-name build-script-build --crate-type bin -C prefer-dynamic -g --cfg feature="default" --out-dir /home/norbert/projects/rust/getting-started/target/build/sdl2-sys-d97611229a2ba47f --emit=dep-info,link -L dependency=/home/norbert/projects/rust/getting-started/target/deps -L dependency=/home/norbert/projects/rust/getting-started/target/deps -Awarnings`
Compiling pkg-config v0.2.1
Running `rustc /home/norbert/.cargo/registry/src/github.com-1ecc6299db9ec823/pkg-config-0.2.1/src/lib.rs --crate-name pkg-config --crate-type lib -g -C metadata=fa0aaf6e1b26fdfc -C extra-filename=-fa0aaf6e1b26fdfc --out-dir /home/norbert/projects/rust/getting-started/target/deps --emit=dep-info,link -L dependency=/home/norbert/projects/rust/getting-started/target/deps -L dependency=/home/norbert/projects/rust/getting-started/target/dep
@NobbZ
NobbZ / main.idr
Last active August 29, 2015 14:02
Does not compile because `main` does not see `y`
module Main
main : IO ()
main = putStrLn (show y)
y : Int
y = 1
@NobbZ
NobbZ / Main.hs
Last active August 29, 2015 14:00
Quick and dirty skelleton
module Main (main) where
import Control.Monad (unless)
import Prelude hiding (Left, Right)
import System.IO (BufferMode (NoBuffering), hSetBuffering, isEOF,
stdout)
type Stone = Int
data Direction = Up
import java.io.FileReader;
import java.io.IOException;
import java.io.BufferedReader;
import java.util.concurrent.Callable;
/**
* Solves Problem 8
*
* Find the greatest product of five consecutive digits in the 1000-digit number.
*
@NobbZ
NobbZ / prime.lhs
Last active February 1, 2021 00:37
Primzahlen in Haskell
> module Main
> where
> import Data.List
Entnimmt einer Liste solange ein Element, bis das Quadrat des Elementes über-
geben an die Funktion f False ergibt.
> takeWhileSquare :: Num a => (a -> Bool) -> [a] -> [a]
> takeWhileSquare f (x:xs) | f (x^2) = x:takeWhileSquare f xs
> | otherwise = []
$.ajax({
type: "GET",
url: $(this).attr('href') + "." + $(this).data("format"),
dataType: "html",
beforeSend: function() {
$("#dialog").dialog("open");
$("#dialog").dialog("option", "title", "Loading…");
$("#dialog").html("<div id=\"loadingbar\"></div>");
$("#dialog").dialog("option", "width", "200px");
return $("#loadingbar").progressbar({
@NobbZ
NobbZ / SpriteFontProblem.cs
Created January 13, 2013 18:27
Can't load the spritefont, get exception: Could not load SpriteFont1 asset!
protected override void LoadContent ()
{
spriteBatch = new SpriteBatch (GraphicsDevice);
_spr_font = Content.Load<SpriteFont>("SpriteFont1");
}
@NobbZ
NobbZ / user.rb
Created December 3, 2012 19:07
Redirecting open-method for rspec test that I dont have to rely on availability of an API-Server
require 'nokogiri'
require 'open-uri'
def User < ActiveRecord::Base
def update_user
xml = Nokogiri::XML(open("http://example.com/api/#{pkey}/#{ukey}"))
self.name = xml.xpath('hordes/headers/owner/citizen').first['name']
self.avatar = xml.xpath('hordes/headers/owner/citizen').first['avatar']
self.last_update = Time.now
@NobbZ
NobbZ / application.html.haml
Created November 20, 2012 21:50
Padrino fragment caching in haml view
-cache "userbox_for_#{current_user.name}", :expires_in => 300
%img{:src => current_user.avatar, :class => "avatar"}
=self.current_user.name
@NobbZ
NobbZ / app.rb
Created November 7, 2012 21:31
Configuring with Padrino
require "yaml"
class DvFa < Padrino::Application
register ScssInitializer
use ActiveRecord::ConnectionAdapters::ConnectionManagement
register Padrino::Rendering
register Padrino::Mailer
register Padrino::Helpers
enable :sessions