Skip to content

Instantly share code, notes, and snippets.

View zuzuleinen's full-sized avatar

Andrei Boar zuzuleinen

View GitHub Profile
@zuzuleinen
zuzuleinen / racing_horses.go
Last active April 1, 2024 05:08 — forked from Chemaclass/racing_horses.go
Racing horses using goroutines
package main
import (
"fmt"
"math/rand"
"os"
"os/exec"
"os/signal"
"time"
)
//**dataURL to blob**
function dataURLtoBlob(dataurl) {
var arr = dataurl.split(','), mime = arr[0].match(/:(.*?);/)[1],
bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n);
while(n--){
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], {type:mime});
}
@zuzuleinen
zuzuleinen / vagrant-hybrisdev-mysql.sh
Created December 1, 2015 14:36 — forked from benwynn/vagrant-hybrisdev-mysql.sh
Vagrant shell provisioning script to install mysql server
#!/bin/bash
debconf-set-selections <<< 'mysql-server mysql-server/root_password password vagrant'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password vagrant'
apt-get update
apt-get install -y mysql-server
<?php
/**
* This class can add WSSecurity authentication support to SOAP clients
* implemented with the PHP 5 SOAP extension.
*
* It extends the PHP 5 SOAP client support to add the necessary XML tags to
* the SOAP client requests in order to authenticate on behalf of a given
* user with a given password.
*
@zuzuleinen
zuzuleinen / runTests.sh
Last active August 29, 2015 14:06 — forked from schemar/runTests.sh
#!/bin/bash
function printHelp {
echo "Load fixtures and run tests"
echo "Usage: runTests.sh [options] [directory]"
echo ""
echo "Options:"
echo " -r|--reset resets the sqlite test database before testing"
echo " -h|--help print this help"
echo ""
<?php
require_once dirname(__DIR__).'/../../../../app/AppKernel.php';
/**
* Test case class helpful with Entity tests requiring the database interaction.
* For regular entity tests it's better to extend standard \PHPUnit_Framework_TestCase instead.
*/
abstract class KernelAwareTest extends \PHPUnit_Framework_TestCase
{

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname