Skip to content

Instantly share code, notes, and snippets.

@AlmogBaku
AlmogBaku / README.md
Last active August 29, 2015 13:56
DoctrineExtenstions: Sluggable: allow non-latin slugs

Allow non-latin slugs using DoctrineExtensions sluggable.

Instructions

  1. add the slugger class (change the namespace of course)
  2. if you using symfony, add the missing lines to your sluggable service as described in symfony-services.yml
  3. if you using only with PHP, call the sluggable service method as described in call.php
@AlmogBaku
AlmogBaku / README.md
Last active August 29, 2015 14:11
Install Mean.io on ubuntu

Install Mean.io on Ubuntu

Just run the follow command:

curl https://gist.githubusercontent.com/AlmogBaku/8820549bf853f6e5aef3/raw/afb0176e60b47952017be3761c458a56a624a579/meanInstall.sh | sh
@AlmogBaku
AlmogBaku / RestController.php
Created April 16, 2015 10:29
Symfony2 REST post ctrl
/**
* Create new service
* @Post("/services/")
*
* @View("::api.html.twig")
* @Security("has_role('ROLE_ADMIN')")
*
* @ApiDoc(
* authenticationRoles={"Admin"},
* input="Rimoto\PolicyBundle\Form\SCEServiceType",
@AlmogBaku
AlmogBaku / UserParamConverter.php
Created May 10, 2015 18:02
Symfony ParamConverter for lookup user by `me`
<?php
/**
* @author Almog Baku
* almog@GoDisco.net
* http://www.GoDisco.net/
*
* 10/05/15 18:43
*/
namespace Rimoto\SubscriberBundle\Request\ParamConverter;
@AlmogBaku
AlmogBaku / IndicatorAggregator.java
Created May 14, 2015 21:40
Indicator Aggregation for PageViewIndicator
package net.rimoto.android.utils;
import android.support.v4.view.ViewPager;
import com.viewpagerindicator.PageIndicator;
import java.util.ArrayList;
/**
* Indicator Aggregator
*/
public class IndicatorAggregator implements PageIndicator {
@AlmogBaku
AlmogBaku / PatchedOAuth2.php
Created December 6, 2015 00:29
Patched OAuth Server to allow `password` grant without secret
<?php
/**
* Created by PhpStorm.
* User: AlmogBaku
* Date: 04/12/2015
* Time: 3:13 PM
*/
namespace Rimoto\ApiBundle\Security;
@AlmogBaku
AlmogBaku / order_ps_res.sh
Last active December 30, 2015 12:05
Order photoshop exported resources for android
#!/bin/bash
res_organize() {
res_dir=$1
res_suffix=$2
if [ ! -d "./${res_dir}" ]; then
mkdir ./${res_dir}
fi;
@AlmogBaku
AlmogBaku / leveledlogger.go
Last active May 18, 2016 23:23
LeveledLogger
package leveledlogger
import (
"github.com/go-kit/kit/log"
)
type LogLevel int
const (
Off LogLevel = iota
@AlmogBaku
AlmogBaku / main.go
Created May 21, 2016 12:05
Sample HTTP Server written in Go
ackage main
import (
"fmt"
"io"
"net/http"
)
func hello(w http.ResponseWriter, r *http.Request) {
io.WriteString(w, "Hello world!")
@AlmogBaku
AlmogBaku / new_es_schema.json
Created September 23, 2016 20:27
New ElasticSearch Sink schema
{
"heapster-2016.09.23": {
"aliases": {
"heapster-cpu-2016.09.23": { },
"heapster-events-2016.09.23": { },
"heapster-filesystem-2016.09.23": { },
"heapster-general-2016.09.23": { },
"heapster-memory-2016.09.23": { },
"heapster-network-2016.09.23": { }
},