Skip to content

Instantly share code, notes, and snippets.

View Thijzer's full-sized avatar
😃

Thijs De Paepe Thijzer

😃
View GitHub Profile
@Thijzer
Thijzer / fork-converter.php
Last active August 29, 2015 13:56
Fork: spoon 2 twig converter
#!/usr/bin/php -q
<?php
// declaring some vars
(!empty($argv[1])) ? $inputFile = $argv[1] : exit('no input file given as parameter' . PHP_EOL);
date_default_timezone_set("Europe/Brussels");
$selection = false;
$method = false;
$fh = fopen('php://stdin', 'r');
@Thijzer
Thijzer / locale.xml
Last active August 29, 2015 13:56
fork locale.xml default file
<?xml version="1.0" encoding="utf-8"?>
<locale>
<frontend>
<core>
</core>
</frontend>
<backend>
<core>
@Thijzer
Thijzer / actionform.php
Created March 5, 2014 22:45
Fork:FE-Module-Detail action + form
<?php
/**
* This is the FE -Module -Detail action + form Gist
* sublime hooks : -Module -Detail
*
*
* @author Thijs De Paepe <thijs.depaepe@wijs.be>
*
*/
### Aliases
# Open specified files in Sublime Text
# "s ." will open the current directory in Sublime
alias s='open -a "Sublime Text"'
# Color LS
colorflag="-G"
alias ls="command ls ${colorflag}"
alias l="ls -lF ${colorflag}" # all files, in long format
server {
listen 8888; ## listen for ipv4; this line is default and implied
root /var/www/blog_test/web;
index index.php;
#site root is redirected to the app boot script
location = / {
try_files @site @site;
}
@Thijzer
Thijzer / transUpDown.sh
Created August 15, 2014 10:58
a working script to start stop transmission torrent files
#!/bin/sh
NETRC=~/.netrc.transmission
TR="transmission-remote -N $NETRC" # command + authentication
FILE="lastrunning.list"
# accepts arguments -sleep -wake
if [ -z "$1" ]; then
echo usage: $0 -sleep or -wake
exit
@Thijzer
Thijzer / clean_install_fork
Last active June 22, 2018 11:05
a simple script for fork CMS clean installing & testing
#!/bin/bash
#
# This script will remove everything and pull in the new version
#
# @version 1.0.0
# @author <thijs@wijs.be>
# mySQL settings
user=$1
password=$2
##
# Opcache recipe
# => convenience rules for dealing with opcode cache in PHP5.5+ applications using opcache (Zend Optimizer+)
##
_cset(:opcache_webroot) { "" }
namespace :opcache do
desc <<-DESC
Create a temporary PHP file to clear cache, call it (using curl) and removes it
#!/bin/bash
#
# This script will export a module out of fork
#
# @version 1.0.0
# @author <thijs@wijs.be>
if [ $# -eq 0 ]
then
echo "please supply a module name"
// create a date
$this->frm->addDate('date', $this->record['date']);
// convert date with mysql
$date = \DateTime::createFromFormat('d/m/Y', $fields['date']->getValue());
$item['date'] = $date->format('Y-m-d').' 00:00:00';