Skip to content

Instantly share code, notes, and snippets.

View nsams's full-sized avatar

Niko Sams nsams

View GitHub Profile
import express from 'express';
import fs from 'fs-extra';
import path from 'path';
const app = express();
const port = 3000;
const targetUrl = 'https://www.vivid-planet.com'; // Hardcoded target URL
const cacheDir = path.join(__dirname, 'cache');
const revalidateAfter = 5*60;
const maxAge = 24*60*60;
@nsams
nsams / kwf_tests_config.local.ini
Created December 17, 2013 14:13
local kwf tests config
[production]
server.domain = kwf.niko.vivid
server.testBrowser.Firefox3.host = niko
server.testBrowser.Firefox3.port = 4444
server.testBrowser.Firefox3.browser = *firefox
server.testBrowser.Firefox3.name = Firefox
server.autoStopTest = false
; service.users.url = http://service.vps.niko.vivid/user2
; service.usersAll.url = http://service.vps.niko.vivid/user2all
@nsams
nsams / kdev
Created December 17, 2013 12:34
bash file for setting up local kde development environment
#!/bin/bash
prepend() { [ -d "$2" ] && eval $1=\"$2\$\{$1:+':'\$$1\}\" && export $1 ; }
export KDEDIR=$HOME/kde
export KDEHOME=$HOME/.kde4-svn
export KDETMP=/tmp/kde4-svn-$USER
mkdir -p $KDETMP
export KDEVARTMP=/var/tmp/kde4-svn-$USER
<?php
$c = file_get_contents('http://www.jhfkreds8.dk/rss/nyheder');
$c = str_replace('<?xml version="1.0" encoding="iso-8859-1"?>', '<?xml version="1.0" encoding="utf-8"?>', $c);
echo $c;
niko@niko:~$ mkdir rsynctest
niko@niko:~$ cd rsynctest/
niko@niko:~/rsynctest$ mkdir foo
niko@niko:~/rsynctest$ echo bar > foo/bar
erstmaligen kopieren:
niko@niko:~/rsynctest$ rsync -av --delete foo foo-copy
sending incremental file list
created directory foo-copy
@nsams
nsams / components:Contact:Component.php
Last active August 29, 2015 14:28
Static Contact Form
<?php
class Contact_Component extends Kwc_Form_Component
{
}
@nsams
nsams / gist:7268c55d3ac4379ae5ab
Last active August 29, 2015 14:26
Phabricator Accept Shortcut
// ==UserScript==
// @name Phabricator Accept Shortcut
// @namespace http://www.vivid-planet.com/
// @version 0.1
// @description enter something useful
// @author Niko Sams
// @match http://phabricator.dev.vivid-planet.com/*
// @grant none
// ==/UserScript==
@nsams
nsams / Component.php
Created May 19, 2015 08:00
Component with settings
<?php
class Foo_Component extends Kwc_Abstract
{
public static function getSettings()
{
$ret = parent::getSettings();
$ret['componentName'] = trlKwfStatic('Foo');
$ret['ownModel'] = 'Kwf_Component_FieldModel';
$ret['extConfig'] = 'Kwf_Component_Abstract_ExtConfig_Form';
return $ret;
INSERT INTO `kwf_update` (`data`) VALUES
('a:245:{i:0;s:35:"Kwc_Advanced_GoogleMap_Update_22701";i:1;s:17:"Vkwf_Update_23173";i:2;s:17:"Vkwf_Update_23304";i:3;s:17:"Vkwf_Update_23341";i:4;s:17:"Vkwf_Update_23343";i:5;s:17:"Vkwf_Update_23478";i:6;s:17:"Vkwf_Update_23643";i:7;s:17:"Vkwf_Update_23644";i:8;s:17:"Vkwf_Update_24420";i:9;s:31:"Kwc_Abstract_Image_Update_24472";i:10;s:17:"Vkwf_Update_24557";i:11;s:17:"Vkwf_Update_24623";i:12;s:17:"Vkwf_Update_24709";i:13;s:17:"Vkwf_Update_24714";i:14;s:17:"Vkwf_Update_24725";i:15;s:17:"Vkwf_Update_24818";i:16;s:17:"Vkwf_Update_24951";i:17;s:17:"Vkwf_Update_25181";i:18;s:17:"Vkwf_Update_25283";i:19;s:17:"Vkwf_Update_25405";i:20;s:17:"Vkwf_Update_25548";i:21;s:17:"Vkwf_Update_26245";i:22;s:17:"Vkwf_Update_26449";i:23;s:17:"Vkwf_Update_26464";i:24;s:17:"Vkwf_Update_26621";i:25;s:17:"Vkwf_Update_26676";i:26;s:17:"Vkwf_Update_27641";i:27;s:17:"Vkwf_Update_28185";i:28;s:17:"Vkwf_Update_28210";i:29;s:17:"Vkwf_Update_28949";i:30;s:17:"Vkwf_Update_29327";i:31;s:17:"Vkwf_Updat
diff --git a/.htaccess b/.htaccess
new file mode 100644
index 0000000..fd089c6
--- /dev/null
+++ b/.htaccess
@@ -0,0 +1,5 @@
+<IfModule mod_rewrite.c>
+ RewriteEngine On
+ RewriteCond %{REQUEST_FILENAME} !-f
+ RewriteRule ^ webroot/index.php [QSA,L]