Skip to content

Instantly share code, notes, and snippets.

View mlebkowski's full-sized avatar
🤷‍♀️

Maciej Łebkowski mlebkowski

🤷‍♀️
View GitHub Profile
#!/bin/bash
export_diff() {
declare project=$1 period=$2 hash=$3
local person="$(git -C "$project" show --format="%an" -s "$hash")"
local target="output/$period/$person/${project#projects/}/$hash.html"
mkdir -p "$(dirname "$target")"
<?php
namespace Nassau\CartoonBattle\Services\Farming\Chores;
use Nassau\CartoonBattle\Entity\Game\Farming\UserFarming;
use Nassau\CartoonBattle\Services\Farming\FarmingChore;
use Nassau\CartoonBattle\Services\Game\Game;
class WatchAdsChore implements FarmingChore
{
Training times and costs:
Level 1
30 minutes
Gun Show:100
Gems:27
Level 2
1 hour
Gun Show:250
<?php
class AclModeratorsUpdater
{
/**
* @var MutableAclProviderInterface
*/
private $provider;
public function __construct(MutableAclProviderInterface $provider)
<?php
namespace Acme\Services;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\Common\Cache\Cache;
use Doctrine\ORM\EntityRepository;
use Kunstmaan\AdminBundle\Entity\User;
use Acme\Entity\Profile;
<?php
function array_to_entries(array $array) {
return array_map(function ($key, $value) {
return [
"key" => $key,
"value" => $value,
];
}, array_keys($array), array_values($array));
}
<?php
Trait OnceTrait {
private $once = [];
protected function once($callback, ...$arguments)
{
$hash = $this->hashOnceMethod(func_get_args());
deploy-to-hub:
steps:
- script:
name: import application slug
code: |-
herokuish slug import < $WERCKER_SOURCE_DIR/slug.tgz
- script:
name: re-create application user
code: |-
useradd -u $(stat -c %u /app) zabka
<?php
function str_startswith($str, $needle) {
return 0 === strpos($str, $needle);
}
function str_startswith($str, $needle) {
return $needle === substr($str, 0, strlen($needle));
}
@mlebkowski
mlebkowski / README.md
Last active May 6, 2016 20:16
Choose one of the parent directories to change to

up

Interactively choose one of the parent dirs to change to.

Requirements & Installation

  1. Install percol
  2. Setup your shell to load the up function at startup
  • In fish use funced up, paste contents, funcsave up
  • In bash paste it in .bashrc or any other file and source it from .bashrc