Skip to content

Instantly share code, notes, and snippets.

View DasLampe's full-sized avatar
🍻

André Flemming DasLampe

🍻
View GitHub Profile
@DasLampe
DasLampe / gist:106893
Created May 5, 2009 08:29
Bubblesort, Delphi, Example (from teacher)
unit bubblesort;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)
@DasLampe
DasLampe / gist:106899
Created May 5, 2009 08:44
Example for stupid pupil
i := 0
repat
ed_display := IntToStr(i - (y div 3);
lb_demo[i - (y div 3) = lb_demo2[i]
until i >= x;
unit suchen;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
Tmain = class(TForm)
h := 1; // Shell-Sort
repeat
h := 3 * h + 1;
until h > LBoxDemo.Items.Count - 1;
repeat
h := h div 3;
for i := h to (LBoxDemo.Items.Count - 1) do
begin
str := LBoxDemo.Items[i];
unit Unit12;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
Tmain = class(TForm)
@DasLampe
DasLampe / cFlexPanel.pas
Created November 13, 2009 08:58
Informatikunterricht - Sieben Segment Anzeige
unit cFlexPanel;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls;
type
TFlexPanel = class(TPanel)
private
// ==UserScript==
// @name FarmVilleAutoAcceptBot
// @namespace http://dasLampe.lano-crew.org
// @description Autoaccept of Gifts, for Greasemonkey
// @include http://apps.facebook.com/onthefarm/*
// @include https://apps.facebook.com/onthefarm/*
// ==/UserScript==
function main()
{
@DasLampe
DasLampe / gist:1275652
Created October 10, 2011 15:47
JQuery select block before current main block
/**HTML CODE
<div class="edit_content_options"><a class="edit_link">Edit</a></div>
<div>
<div>Edit block, with event</div>
</div>*/
function find_parent(current_block)
{
var parent, searchblock, edit_option;
@DasLampe
DasLampe / gist:1420919
Created December 2, 2011 00:19
Find emailaddresses, make clickable and encode with base64
/********Code based on https://gist.github.com/907604 *********
The code find email addresses and proteceds for bots.
Make the addresses clickable with webtoolkit.base64.js and the following code (JQuery requiered):
$('a').each(function() {
var href, mailaddress;
href = $(this).attr('href');
if(href.search(/mailto:/) != -1)
{
@DasLampe
DasLampe / spotlight_bugfix.sh
Created October 22, 2012 21:15
[Mac OS X] Fix broken permissions and stop spotlight reindexing
#! /bin/bash
########################################################
#Copright: 2012, DasLampe <daslampe@lano-crew.org>
#Original Source: https://gist.github.com/gists/3934414/
#
#Licence Information:
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or any later version.
#This program is distributed in the hope that it will be useful,