Skip to content

Instantly share code, notes, and snippets.

View tristanlins's full-sized avatar

Tristan Lins tristanlins

View GitHub Profile
@tristanlins
tristanlins / build.gradle
Created March 2, 2019 13:15
Gradle Jacoco Plugin and Gitlab Coverage
plugins {
id 'jacoco'
}
jacocoTestReport {
reports {
xml.enabled true
}
}
@tristanlins
tristanlins / UserDao.php
Created February 23, 2019 11:27
Programmierstil / Der Anfänger & Der Profi
<?php
class UserDao {
public function findByLoginFromRequest(Request $request)
{
$sql = 'SELECT user FROM users WHERE login=:login';
$login = $request->request->get('login');
$statement = $this->database->prepare($sql);
$statement->bindValue(':login', $login);
@tristanlins
tristanlins / UserDao.php
Created February 23, 2019 11:26
Programmierstil / Der gesittete Programmierer
<?php
class UserDao {
public function findByLoginFromRequest(Request $req)
{
$login = $req->request->get('login');
$statement = $this->db->prepare('SELECT user FROM users WHERE login=?');
$statement->bindValue(1, $login);
return $statement->execute() ? $statement->fetch(\PDO::FETCH_ASSOC) : false;
}
}
@tristanlins
tristanlins / UserDao.php
Created February 23, 2019 11:24
Programmierstil / Der schreibfaule Hacker
<?php
class UserDao {
public function findByLoginFromRequest(Request $r) {
$s = $this->c->prepare('SELECT user FROM users WHERE login=?');
$s->bindValue(1, $r->request->get('login'));
return $s->execute() ? $s->fetch(\PDO::FETCH_ASSOC) : false;
}
}
# @file /etc/systemd/system/docker-postgres.service
# @see https://docs.docker.com/articles/host_integration/
[Unit]
Description=postgres container
Requires=docker.service
After=docker.service
[Service]
Restart=always
@tristanlins
tristanlins / fstab
Last active June 22, 2016 08:21
Using ext4 as /tmp
# Using ext4 as fast as it can be...
UUID=... /tmp ext4 barrier=0,data=writeback,nouser_xattr,noacl,noatime,nodiratime 0 0
# Path to your oh-my-zsh installation.
export ZSH=/home/lins/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="avit"
# Uncomment the following line to use case-sensitive completion.
# ~/.config/plasma-workspace/shutdown/gpg-agent-shutdown.sh
#!/bin/sh
echo KILLAGENT | gpg-connect-agent
@tristanlins
tristanlins / ssh-agent-shutdown.sh
Created January 24, 2016 08:46
ssh-agent under plasma 5 / arch
# ~/.config/plasma-workspace/shutdown/ssh-agent-shutdown.sh
#!/bin/sh
[ -z "$SSH_AGENT_PID" ] || eval "$(ssh-agent -k)"
cmake_minimum_required(VERSION 3.2)
project(url-function-bug)
set(CMAKE_BUILD_TYPE Debug)
set(SOURCE_FILES url-function-bug.c empty.cpp)
include_directories("../libsass/include")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
message("search for libsass static library in: ${CMAKE_SOURCE_DIR}/../libsass/lib")