Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name immobilienscout++
// @namespace kch42
// @include https://www.immobilienscout24.de/*
// @version 2
// @grant none
// ==/UserScript==
/*
* Immobilienscout24 Suche verbessern.
@quantenProjects
quantenProjects / toGeoJSON.js
Last active July 27, 2019 20:52
convert the overnight places from wildes-sh.de into a geojson Source: https://www.wildes-sh.de/index.php?id=12&t=1522940690568 --- Public Domain ---
var data = require("./wildesSH.json");
var features = [];
for (platz of data) {
//console.log(platz["ort"]["lon"]);
var feature = {"type":"Feature"};
feature["geometry"] = {"type":"Point"}
feature["geometry"]["coordinates"] = [];
@jlgerber
jlgerber / CMakeLists.txt
Last active December 14, 2023 07:52
cmake - handling executable and library with same name
# Lets say we want to add a library and an executable, both with the same name.
# In this example, it is resman
add_library(resman ${src_cpps} ${src_hpps} )
target_link_libraries(resman ${Boost_LIBRARIES} ${LIBYAML} ${LIBFMT})
#
# Add resman executable
#
# We call the executable resman-bin
add_executable(resman-bin main.cpp )
@justecorruptio
justecorruptio / 2048.c
Created April 4, 2014 03:49
Tiny 2048 in C!
M[16],X=16,W,k;main(){T(system("stty cbreak")
);puts(W&1?"WIN":"LOSE");}K[]={2,3,1};s(f,d,i
,j,l,P){for(i=4;i--;)for(j=k=l=0;k<4;)j<4?P=M
[w(d,i,j++)],W|=P>>11,l*P&&(f?M[w(d,i,k)]=l<<
(l==P):0,k++),l=l?P?l-P?P:0:l:P:(f?M[w(d,i,k)
]=l:0,++k,W|=2*!l,l=0);}w(d,i,j){return d?w(d
-1,j,3-i):4*i+j;}T(i){for(i=X+rand()%X;M[i%X]
*i;i--);i?M[i%X]=2<<rand()%2:0;for(W=i=0;i<4;
)s(0,i++);for(i=X,puts("\e[2J\e[H");i--;i%4||
puts(""))printf(M[i]?"%4d|":" |",M[i]);W-2
@OrganicPanda
OrganicPanda / hacky-scrollbar-resize-listener.js
Last active April 7, 2024 10:53
A sham that will throw a window resize event even when scrollbars are added/removed (this is not something the standard window resize event does). Tested in IE9+, Chrome & Firefox latest.
// Demo: http://jsfiddle.net/pFaSx/
// Create an invisible iframe
var iframe = document.createElement('iframe');
iframe.id = "hacky-scrollbar-resize-listener";
iframe.style.cssText = 'height: 0; background-color: transparent; margin: 0; padding: 0; overflow: hidden; border-width: 0; position: absolute; width: 100%;';
// Register our event when the iframe loads
iframe.onload = function() {
// The trick here is that because this iframe has 100% width
@silvasur
silvasur / fix.php
Created October 1, 2013 22:54
Fixes the metadata files of a Ratatöskr plugin repository.
#!/usr/bin/env php
<?php
/*
This will repair the metadata of the packages in your repository.
Place it into the root directory of your reository and run it via the terminal (php fix.php).
If everything has worked, nothing will be printed.
You should delete this script after fixing the metadata.
*/