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;
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]
$ret['assets']['files'][] = new Vkwc_Statistics_Opt_ConfigAsset();
<?php
class Vkwc_Statistics_Opt_ConfigAsset extends Kwf_Assets_Dependency_Abstract
{
public function getMimeType()
{
return 'text/javascript';
@nsams
nsams / gist:03edc0c673a5f4e9bb87
Last active August 29, 2015 14:07
Install pre commit hook
#zuerst im template den pre-commit hook eintragen (für neue+geklonte repos)
sudo ln -s $HOME/www/library/kwfscripts/pre-commit /usr/share/git-core/templates/hooks/pre-commit
#dann mit diesem script für alle bestehenden auch den verwenden:
cd ~/www
./library/kwfscripts/vivid/install-pre-commit-hook.php
diff --git a/Kwf/Assets/Dependency/File.php b/Kwf/Assets/Dependency/File.php
index 74ef509..bd4b10e 100644
--- a/Kwf/Assets/Dependency/File.php
+++ b/Kwf/Assets/Dependency/File.php
@@ -114,6 +114,10 @@ class Kwf_Assets_Dependency_File extends Kwf_Assets_Dependency_Abstract
$cssClass = substr($cssClass, strlen($i)+1);
}
}
+ if ($this->getFileName() == getcwd().'/themes/Theme/Menu/Main/Component.scss') {
+ p($paths);