Skip to content

Instantly share code, notes, and snippets.

@DaRaFF
DaRaFF / index.js
Created March 8, 2018 21:56
Ice Hockey Probability to stay in the league
_ = require('lodash')
const teams = [
{
id: 1,
name: 'Ice Dukes',
points: 16
},
{
id: 2,
@DaRaFF
DaRaFF / Bluewin Production Performance Test 2018-02-02.txt
Created February 2, 2018 13:20
Bluewin Production Performance Test 2018-02-02.txt
-
@DaRaFF
DaRaFF / Bluewin Staging Performance Test 2018-01-30.txt
Last active January 30, 2018 18:08
Bluewin Staging Performance Test 2018-01-30
We couldn’t find that file to show.
@DaRaFF
DaRaFF / terminator.md
Last active September 8, 2015 10:46
Terminator Settings

vim ~/.config/terminator/config

[global_config]
  title_hide_sizetext = True
  title_transmit_fg_color = "#000000"
  sticky = True
  title_inactive_fg_color = "#ffffff"
  suppress_multiple_term_dialog = True
  title_receive_fg_color = "#000000"
@DaRaFF
DaRaFF / coffeescript knowhow
Created June 17, 2015 09:10
Some notes on Coffeescript notation
class Animal
constructor: (name) ->
# @name is an instance property
@name = name
# This is an object function
# This function can be accessed with @getSomething() from the class itself
getSomething: -> return "hello"
@DaRaFF
DaRaFF / sublime 3.md
Last active December 7, 2015 15:48
sublime 3
@DaRaFF
DaRaFF / improvement.php
Last active December 22, 2015 03:58
Example that the rule "return early as possible" leads to more readable code The original code has been taken from: https://github.com/nzzdev/epaper/blob/7d0488f6fd7f716fb2b73ebd0450a8f1780b4c97/src/NZZ/EpaperBundle/Import/IssueUploader.php#L32-L56
<?php
public function upload($sourceFileName, $amazonS3IsAclPrivate = false)
{
$metadata = array();
$uploadPath = $this->calculateUploadPath($sourceFileName);
if ($this->sameFileWithSameHashExists($uploadPath, $sourceFileName)) {
$this->logger->info("File " . $uploadPath . " with same hash already exists. File will not be uploaded.");
return $uploadpath;
@DaRaFF
DaRaFF / ubuntu-php-development-environment.md
Last active October 13, 2023 00:16
Ubuntu php development environment

#Introduction If you're a php developer on ubuntu, there comes the time where you have to install/reinstall your system. I did it already a few times and i decided to write down the steps for a typical web developer stack with php. This is for a developer machine and not for a live environment!

I hope it helps you too!

fyi @mheiniger and me started with an installer here: https://github.com/mheiniger/webdev-setup

@DaRaFF
DaRaFF / gist:1922267
Created February 27, 2012 07:30
nginx symfony2 example configs
#localtunnel
server {
listen 80;
server_name 3ay5.localtunnel.com;
access_log /var/log/nginx/digital-version.nzz.lo.log;
location / {
root /home/ralphmeier/eos/digital-version/web;
index app_dev.php;
@DaRaFF
DaRaFF / gist:1907461
Created February 25, 2012 09:12
apache2 symfony2 example configs
<VirtualHost *:80>
ServerName nzz.lo
DocumentRoot /home/daraff/eos/www/web
ErrorLog ${APACHE_LOG_DIR}/www.error.log
CustomLog ${APACHE_LOG_DIR}/www.access.log common
<Location />
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app_dev.php [QSA,L]
</Location>