Skip to content

Instantly share code, notes, and snippets.

View hacfi's full-sized avatar

hacfi hacfi

  • Certified Symfony developer
  • Europe
View GitHub Profile
@stof
stof / ConditionalValidationGroup.php
Created September 10, 2014 12:03
Conditional validation group based on the state of the entity
<?php
namespace Incenteev\WebBundle\Validator;
use Symfony\Component\Validator\Constraint;
/**
* @Annotation
* @Target({"CLASS", "ANNOTATION"})
*/
@sahilsk
sahilsk / ELK Procedure
Created August 26, 2014 04:53
nginx proxy configuration for elasticsearch
## Install Docker
```
# install the backported kernel
$ sudo apt-get update
$ sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
$ sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
#!/bin/bash
#
# Automate mysql secure installation for debian-baed systems
#
# - You can set a password for root accounts.
# - You can remove root accounts that are accessible from outside the local host.
# - You can remove anonymous-user accounts.
# - You can remove the test database (which by default can be accessed by all users, even anonymous users),
# and privileges that permit anyone to access databases with names that start with test_.
@nikicat
nikicat / travis.sh
Last active January 6, 2016 10:34
Shell build script to handle .travis.yml inside Jenkins
#!/bin/bash -exv
function getvalue() {
shyaml get-value $1 < .travis.yml
}
function getencvalue() {
shyaml get-value $1.secure < .travis.yml | base64 -d | openssl rsautl -decrypt -inkey .jenkins.pem
}
@BinaryMuse
BinaryMuse / README.md
Last active February 1, 2017 00:51
Integrating React with Marionette

Integrating React with Marionette

See ReactComponentView and BackboneModelWatchMixin, below.

Notes

The BackboneModelWatchView could use some additional methods to allow adding/removing watched models after the component is created.

@oroce
oroce / README.md
Created June 12, 2014 07:51
nginx request id
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <mleppich@muhqu.de>
#
# 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
# Reveal Library
chflags nohidden ~/Library
# Install homebrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
# Install homebrew cask
brew install caskroom/cask/brew-cask
# Install all necessary sw
brew cask install google-chrome
brew cask install firefox
brew cask install spectacle
#!/usr/bin/env zsh
branch=`git rev-parse --abbrev-ref HEAD`
git show-branch | ack '\*' | ack -v "$branch" | head -n1 | sed 's/.*\[\(.*\)\].*/\1/' | sed 's/[\^~].*//'
# How it works:
# 1| Display a textual history of all commits.
# 2| Ancestors of the current commit are indicated
# by a star. Filter out everything else.
@philfreo
philfreo / hijack-links.js
Created February 26, 2014 22:41
Hijack in-site links for Backbone.js