Skip to content

Instantly share code, notes, and snippets.

@fieg
fieg / wait_for_it.sh
Created March 30, 2023 10:15
Bash function to wait for a url to be available with a fibonacci backoff
#!/usr/bin/env bash
# Function to wait for a url to be available with a fibonacci backoff
#
# Usage:
# wait_for_it <url>
#
# Examples:
# wait_for_it "http://some-service:port/path/"
# wait_for_it "google.com"
@fieg
fieg / fiddle.response.html
Last active March 27, 2018 18:35
ias jsfiddle page 2
<!DOCTYPE html>
<html>
<body>
<div class="container">
<div class="post" id="post10">
<strong>item 10</strong>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis.</p>
</div>
<div class="post" id="post11">
<strong>item 11</strong>
@fieg
fieg / fiddle.response.html
Last active March 13, 2018 22:06
IAS response
<!DOCTYPE html>
<html>
<body>
<div class="container">
<div class="post" id="post3">
<strong>item 3</strong>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis.</p>
</div>
<div class="post" id="post4">
<strong>item 4</strong>
@fieg
fieg / LoginController.php
Last active October 18, 2023 11:01
Symfony4 Login Form Type
<?php
use LoginType;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
final class LoginController extends Controller
{
/**
@fieg
fieg / redis-expire.sh
Last active October 10, 2022 23:09
Set expire on large set of keys using pattern in Redis
#!/bin/bash
if [ $# -ne 4 ]
then
echo "Usage: $0 <host> <port> <pattern> <seconds>"
exit 1
fi
cursor=-1
keys=""
@fieg
fieg / .bash_profile
Created April 11, 2012 07:57
.bash_profile for OSX including autocomplete for ssh hosts, default variables and some aliases
export PATH=~/bin:/usr/local/bin:/usr/local/mysql/bin:/usr/local/sbin:$PATH
export EDITOR=vim
export APPLICATION_ENV="development"
export CLICOLOR=1
export LSCOLORS=dxfxcxdxbxegedabagacad
alias composer="php /usr/local/bin/composer.phar"
_complete_ssh_hosts ()
{
@fieg
fieg / array_qsort2.php
Created October 11, 2011 22:09
Sort a multi dimensional array on a column
<?php
/*
* Sort a multidimensional array on a column
*
* For example:
* <code>
* <?php array_qsort2($users, "username", "ASC"); ?>
* </code>
*