Skip to content

Instantly share code, notes, and snippets.

@sweikenb
sweikenb / .zshrc
Last active October 23, 2024 08:08
Linux ZSH dotconf
#
# Load Antigen ZSH package manager
#
ANTIGEN_PATH="${HOME}/antigen.zsh"
if [ ! -f "${ANTIGEN_PATH}" ]; then
# auto-install antigen
curl -L git.io/antigen > ${ANTIGEN_PATH}
fi
source "${ANTIGEN_PATH}"
@sweikenb
sweikenb / navigation_practice.php
Created February 6, 2019 11:28
PHP array practice
<?php
/*
* Conditions:
***********************************************************************************************************************
*
* Do not modify or edit this file/array -> include it into your working file and use the $navigation array as it is.
*
*
* Tasks:
@sweikenb
sweikenb / array_practice.php
Created February 5, 2019 14:42
PHP array practice (recursion)
<?php
/*
* Conditions:
***********************************************************************************************************************
*
* Do not modify or edit this file/array -> include it into your working file and use the $tree array as it is.
*
*
* Tasks:
@sweikenb
sweikenb / Dockerfile
Created January 30, 2019 15:01
Simple LAMP Docker Setup
FROM php:7.2.1-apache
RUN docker-php-ext-install pdo pdo_mysql mysqli
/**
* strap.js by Simon Schroeer | http://strapjs.org | License: MIT
*/
var strapjs_root = {},
strapjs_eventstack = {},
strapjs = {};
/**
* Get the global root object
/**
* EventDispatcherEvent
*
* @param eventName
* @param payload
* @constructor
*/
var EventDispatcherEvent = function (eventName, payload) {
this._stoppped = false;
this._name = eventName;
/**
* Creates the container instance
*
* @param {Object|null} params
* @constructor
*/
var Dicon = function (params) {
this.params = {};
this.services = {};
this.container = {};
@sweikenb
sweikenb / README.md
Created August 9, 2016 18:35 — forked from tjamps/README.md
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@sweikenb
sweikenb / deploy.sh
Last active April 18, 2016 08:47
Dimple GIT deployment for symfony apps
#!/bin/bash
#
# Example and very basic deplosy script
#
# change to the right directory
cd /path-to-project-root;
# Remove unsecure files
@sweikenb
sweikenb / GitlabSyncCommand
Last active August 29, 2015 14:01
GitlabSyncCommand for custom packagist installations
<?php
namespace Packagist\WebBundle\Command;
use Gitlab\Api\Projects;
use Gitlab\Api\Repositories;
use Packagist\WebBundle\Entity\Package;
use Packagist\WebBundle\Entity\User;
use sweikenb\Library\Threading\Thread;
use sweikenb\Library\Threading\ThreadRegistry;