Skip to content

Instantly share code, notes, and snippets.

View wingsuitist's full-sized avatar

Sam Felix wingsuitist

  • Basel
View GitHub Profile
@wingsuitist
wingsuitist / 0_reuse_code.js
Created January 20, 2014 07:00
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
# searches for the pattern within a repo and removes every single file one by one
# attention: if the file exists twice it will be removed everyware
pattern="typo3tempbkp"
for i in `git rev-list --objects --all | sort -k 2 | cut -f 2 -d\ | uniq|grep $pattern` ; do \
java -jar ~/Google\ Drive/jf-res/bfg/bfg-1.11.8.jar --delete-files `basename $i`
done
How to find the next buzzword:
Lets take something that was around for a long time:
WCMS => web content management system
=> w == web - Today it’s not only web, so leave it away
CMS => content management system
=> c == content or social media, experience, learning, bla bla bla
=> so no c, it’s not right
XMS => x management system
@wingsuitist
wingsuitist / missing-php5-packages-debian.sh
Created January 5, 2015 16:48
compare installed and available packages => in this example php5-*
dpkg --get-selections|grep php5-|sed -e 's/^\([^\t]*\).*$/\1/g'|sort > php5-installed-pkgs.txt
apt-cache search php5- |sed -e 's/^\([^ ]*\) -.*$/\1/g' -|sort > php5-available-pkgs.txt
comm -23 php5-available-pkgs.txt php5-installed-pkgs.txt
Fluid in pibase:
var $view;
public function getView($action) {
$this->extPath = t3lib_extMgm::extPath($this->extKey);
$this->view = t3lib_div::makeInstance('Tx_Fluid_View_StandaloneView');
$this->view->setLayoutRootPath(t3lib_extMgm::extPath($this->extKey) . 'Resources/Private/Layouts/');
@wingsuitist
wingsuitist / .gitignore
Last active August 29, 2015 14:13
.gitignore to track a linux server
# put this in your / root folder
# ignore everything but /etc, .gitignore and /root
/*
!/etc
!.gitignore
!/root
!/var
/var/*
!/var/www
!/var/spool
@wingsuitist
wingsuitist / notes.sql
Created January 24, 2015 13:11
mariadb_mysql_notes
-- create user with username and password that has all rights on databases called username_xxx
CREATE USER 'username'@'%' IDENTIFIED BY PASSWORD PASSWORD('password');
GRANT ALL PRIVILEGES ON `username\_%`.* TO 'username'@'%';
@wingsuitist
wingsuitist / t3changelogstats.sh
Created June 10, 2015 18:23
look for authors in TYPO3 changelog
cat 6.2.13.txt | sed -e 's/.*(\(.*\)).*/\1/g' | sort | uniq -c
@wingsuitist
wingsuitist / fb_invites
Last active August 29, 2015 14:25
facebook invoke invite
/** never use this, this is only proove of concept for educational purpose **/
inviteA = document.getElementsByTagName('a'); for(var i = 0; i < inviteA.length; i++) { if(inviteA[i].innerHTML.indexOf("Invite") > -1) {console.log(inviteA[i].innerHTML);inviteA[i].style.color = "red";console.log(inviteA[i].attributes.ajaxify);xmlhttp=new XMLHttpRequest();xmlhttp.open("GET","inviteA[i].attributes.ajaxify",true);xmlhttp.send();};}
@wingsuitist
wingsuitist / theShell.php
Last active September 24, 2015 13:02
nice example of magic _call method in php
<?php
class theShell{
public function __call($command, $arguments) {
exec($command.' '.implode(' ', $arguments), $out, $returnCode);
echo implode("\n", $out);
return $returnCode;
}
}