Skip to content

Instantly share code, notes, and snippets.

View dinamic's full-sized avatar
😳
I would rewrite the world, but they won't give me the source code.

Nikola Petkanski dinamic

😳
I would rewrite the world, but they won't give me the source code.
View GitHub Profile
@saetia
saetia / gist:1623487
Last active July 16, 2024 05:56
Clean Install – OS X 10.11 El Capitan

OS X Preferences


most of these require logout/restart to take effect

# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false

# Set a shorter Delay until key repeat
@mathiasverraes
mathiasverraes / phplint.sh
Created July 12, 2012 07:42
Recursive PHP Lint script
#!/bin/bash
for file in `find .`
do
EXTENSION="${file##*.}"
if [ "$EXTENSION" == "php" ] || [ "$EXTENSION" == "phtml" ]
then
RESULTS=`php -l $file`
@troelskn
troelskn / parse_console.php
Created October 31, 2012 12:02
parse_console.php
<?php
function parse_console($argv = null) {
$argv = isset($argv) ? $argv : $_SERVER['argv'];
$basename = array_shift($argv);
$arguments = array();
$options = array();
$switches = array();
$tmp = null;
foreach ($argv as $arg) {
if (preg_match('/^--([^=]+)=(.*)$/', $arg, $reg)) {
@dbu
dbu / Vagrantfile
Created November 13, 2012 09:26
vagrant setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
this_dir = File.dirname(__FILE__) + "/"
require this_dir + "vagrant/hostmaster.rb"
Vagrant::Config.run do |config|
# define some colors for our output
def colorize(text, color_code) "#{color_code}#{text}\033[0m" end
@defrag
defrag / gist:4547311
Created January 16, 2013 14:02
Beanstalkd command line process for listening to symfony2 bg jobs.
<?php
namespace PW\ApplicationBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand,
Symfony\Component\Console\Input\InputArgument,
Symfony\Component\Console\Input\InputInterface,
Symfony\Component\Console\Input\StringInput,
Symfony\Component\Console\Output\OutputInterface;
@stuartcarnie
stuartcarnie / clear-apc.php
Last active February 25, 2024 11:07
Self-contained php script to clear shared-memory cache in php5-fpm via command-line. In this instance it is clearing APC, but can be easily changed to clear other shared-memory caches.
#!/usr/bin/env php
<?php
/*
Copyright 2013 Stuart Carnie and other contributors
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
@fazy
fazy / gist:5568416
Last active December 17, 2015 06:49
Java-based example demonstrating the behaviour of versionable child nodes after an update operation. The expected behaviour is that cloning a node will clone its child, even if the child is versionable, while updating a node will only update the node itself, and not the versionable child.
import javax.jcr.Credentials;
import javax.jcr.Node;
import javax.jcr.Repository;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.Workspace;
import javax.jcr.SimpleCredentials;
import javax.jcr.version.*;
import ch.liip.jcr.davex.DavexClient;
@Turin86
Turin86 / WSSoapClient.php
Last active April 24, 2023 19:37 — forked from johnkary/WSSoapClient.php
WS-Security for PHP SoapClient
<?php
/**
* This class can add WSSecurity authentication support to SOAP clients
* implemented with the PHP 5 SOAP extension.
*
* It extends the PHP 5 SOAP client support to add the necessary XML tags to
* the SOAP client requests in order to authenticate on behalf of a given
* user with a given password.
*
@jbenet
jbenet / simple-git-branching-model.md
Last active June 17, 2024 14:53
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@nateevans
nateevans / MenuBuilder.php
Created April 3, 2014 16:56
KNP Menu Bundle with Bootstrap 3 and Font Awesome 4 (see http://bit.ly/1sd1rJr , thanks to Niels Mouthaan!)
<?php
namespace Acme\HelloBundle\Menu;
use Knp\Menu\FactoryInterface;
use Symfony\Component\DependencyInjection\ContainerAware;
class MenuBuilder extends ContainerAware
{
public function mainMenu(FactoryInterface $factory, array $options)