Skip to content

Instantly share code, notes, and snippets.

View clicman's full-sized avatar
🌏

Clicman clicman

🌏
  • CTO at Savl GmbH
  • Almaty, Kazakhstan
View GitHub Profile
@clicman
clicman / Runner.java
Created January 27, 2015 17:41
Handle suite events in testStarted/finished
import org.junit.internal.requests.ClassRequest;
import org.junit.runner.Description;
import org.junit.runner.Request;
import org.junit.runner.notification.RunListener;
import org.junit.runner.notification.RunNotifier;
class Runner {
public void run() {
<?php
namespace Stom\Api\Util\JsonMapper;
use InvalidArgumentException;
use ReflectionClass;
use ReflectionMethod;
/**
@clicman
clicman / url-tag-username-parser.js
Last active October 25, 2015 09:59
Ultimate javascript hashtag user and url parting function
function parse(text) {
//URL prefix for tag
var tagUrl = "#/tag/?tag=";
//URL prefix for username
var profileurl = "#/profile/?username=";
var parseURL = function (value) {
console.log(value);
@clicman
clicman / enum.babel.js
Created January 31, 2016 19:55 — forked from nathggns/enum.babel.js
Mini enum-like solution. Probably not all that useful;
import { invert, assign, object } from 'lodash';
class Enum {
// Should probably look into using a Symbol for this instead??
static privateKey = '_private';
constructor(map) {
const inverted = invert(map);
const keys = Object.keys(map);
@clicman
clicman / MongoJoin.php
Last active February 8, 2016 05:12
This gist brings join functionality to Doctrine Mongo ODM framework.
<?php
/*
* Copyright (c) 2016, Viktor Sidochenko <viktor.sidochenko@gmail.com>
* All rights reserved.
*
* BSD License
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
import React from 'react';
class BadFormatting extends React.Component {
handleClick() {
console.log('clicked');
}
render() {
return (
@clicman
clicman / dockerstats.sh
Created August 7, 2017 16:08
How to get container name in docker stats
docker stats $(docker ps | awk '{if(NR>1) print $NF}')

Keybase proof

I hereby claim:

  • I am clicman on github.
  • I am clicman (https://keybase.io/clicman) on keybase.
  • I have a public key ASCaMnsELGOG4-SI60C4pIO63c-ngQ6_7hGvdbaKZFI6NQo

To claim this, I am signing this object: