Skip to content

Instantly share code, notes, and snippets.

Giacomo Tüfekci tuefekci

Block or report user

Report or block tuefekci

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tuefekci
tuefekci / mongoDBBackup.php
Last active Nov 30, 2018
mongodb php backup
View mongoDBBackup.php
/**
*
* @copyright Copyright (c) 2018. Giacomo Tüfekci (https://www.tuefekci.de)
* @github https://github.com/tuefekci
* @license https://www.tuefekci.de/LICENSE.md
*
*/
// IMPORTANT: $this->filesystem needs to be adapted to use case! Also this is not intended for Production Use!
// TODO: For productive use add Exception handling etc. depended on use case.
@tuefekci
tuefekci / nav-menu-item-custom-fields.php
Created Nov 18, 2016 — forked from kucrut/nav-menu-item-custom-fields.php
Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
View nav-menu-item-custom-fields.php
<?php
/**
* Proof of concept for how to add new fields to nav_menu_item posts in the WordPress menu editor.
* @author Weston Ruter (@westonruter), X-Team
*/
add_action( 'init', array( 'XTeam_Nav_Menu_Item_Custom_Fields', 'setup' ) );
class XTeam_Nav_Menu_Item_Custom_Fields {
static $options = array(
@tuefekci
tuefekci / QRLogo.php
Created May 11, 2016 — forked from NTICompass/QRLogo.php
QR Code + Logo Generator
View QRLogo.php
<?php
/**
* QR Code + Logo Generator
*
* http://labs.nticompassinc.com
*/
$data = isset($_GET['data']) ? $_GET['data'] : 'http://labs.nticompassinc.com';
$size = isset($_GET['size']) ? $_GET['size'] : '200x200';
$logo = isset($_GET['logo']) ? $_GET['logo'] : FALSE;
View php-full-depth-case-insensitive-file-exists.php
<?php
/**
* Single level, Case Insensitive File Exists.
*
* Only searches one level deep. Based on
* https://gist.github.com/hubgit/456028
*
* @param string $file The file path to search for.
*
* @return string The path if found, FALSE otherwise.
View rsync-examples.sh
rsync -rlptuvhz -e ssh username@my-dev-server.dev:/path/to/dir .
# -r Recursive
# -l Copy symlinks as symlinks
# -p Copy permisisons
# -t Copy times
# -u Update. Skip files that are newer on receiving end.
# -v Verbose.
# -h Output numbers in a human-readable format
# -z Use compression when sending data over the network.
@tuefekci
tuefekci / level8.js
Created Jan 13, 2016
elevator level8.js - still like level4
View level8.js
{
init: function(elevators, floors) {
console.log(elevators);
// # Elevators
elevators.forEach(function(elevator) {
elevator.on("stopped_at_floor", function(floorNum) {
if(elevator.destinationQueue.indexOf(floorNum) !== -1) {
elevator.destinationQueue.splice(elevator.destinationQueue.indexOf(floorNum), 1);
}
});
@tuefekci
tuefekci / level7.js
Created Jan 13, 2016
elevator level7.js - still like level4 probably last time it works without optimazations
View level7.js
{
init: function(elevators, floors) {
console.log(elevators);
// # Elevators
elevators.forEach(function(elevator) {
elevator.on("stopped_at_floor", function(floorNum) {
if(elevator.destinationQueue.indexOf(floorNum) !== -1) {
elevator.destinationQueue.splice(elevator.destinationQueue.indexOf(floorNum), 1);
}
});
@tuefekci
tuefekci / level6.js
Created Jan 13, 2016
elevator level6.js - still same like level4
View level6.js
{
init: function(elevators, floors) {
console.log(elevators);
// # Elevators
elevators.forEach(function(elevator) {
elevator.on("stopped_at_floor", function(floorNum) {
if(elevator.destinationQueue.indexOf(floorNum) !== -1) {
elevator.destinationQueue.splice(elevator.destinationQueue.indexOf(floorNum), 1);
}
});
@tuefekci
tuefekci / level5.js
Created Jan 13, 2016
elevator level5.js - same like level 4
View level5.js
{
init: function(elevators, floors) {
console.log(elevators);
// # Elevators
elevators.forEach(function(elevator) {
elevator.on("stopped_at_floor", function(floorNum) {
if(elevator.destinationQueue.indexOf(floorNum) !== -1) {
elevator.destinationQueue.splice(elevator.destinationQueue.indexOf(floorNum), 1);
}
});
@tuefekci
tuefekci / level4.js
Created Jan 13, 2016
elevator level4.js
View level4.js
{
init: function(elevators, floors) {
console.log(elevators);
// # Elevators
elevators.forEach(function(elevator) {
elevator.on("stopped_at_floor", function(floorNum) {
if(elevator.destinationQueue.indexOf(floorNum) !== -1) {
elevator.destinationQueue.splice(elevator.destinationQueue.indexOf(floorNum), 1);
}
});
You can’t perform that action at this time.