Skip to content

Instantly share code, notes, and snippets.

@CodeBrauer
CodeBrauer / codecandies_001.php
Last active June 27, 2016 09:10
some codecandies I just find sometimes...
<?php
// most complicated way to reformart a date... also deprecated function
ereg("([0-9]{4}).([0-9]{2}).([0-9]{2})", $value['check_in'], $alter);
$bdate="$alter[3].$alter[2].$alter[1]";
echo $bdate;
@CodeBrauer
CodeBrauer / composer.json
Created September 30, 2015 16:28
youtube playlist to spotify uri
{
"require": {
"google/apiclient": "^1.1",
"jwilsson/spotify-web-api-php": "^0.10.0"
}
}
@CodeBrauer
CodeBrauer / checkInternet.command
Created November 9, 2015 10:47
Easy internet-connection checker - If Internet connection works: plays sound
#!/bin/bash
/usr/bin/php /Users/xxx/dev/internetz.php
exit;
# This file can be opened with default Terminal App on Mac OS X

Easy Linux SSMTP Configuration with Mailgun

You need a domain where you can add:

  • TXT domain records and subdomains for sendings
  • CNAME records for tracking
  • MX records for receiving (optional)
fps_max_menu "60"
cl_autowepswitch "0"
viewmodel_fov 90
voice_mixer_volume 0.75
cl_cmdrate "128"
cl_updaterate "128"
cl_interp "0"
rate "128000"
cl_radar_scale 0.4
cl_disablefreezecam 1
# ==============================================================================
# Don't run this directly!
# Read the script and copy'n'paste the commands you need.
# ==============================================================================
# by CodeBrauer <codebrauer@gmail.com> 2017 v2.0.1
cd hacked_website/public_html/
# ============ Step 0) ============
#> Do a backup! If you have to use this script, it's clear you have no backups,
@CodeBrauer
CodeBrauer / show_absolute_timestamps_commits_log_gitlab.js
Last active January 24, 2016 14:56
show absolute timestamps commits log gitlab
setInterval(function() {
timestamps = document.querySelectorAll('time');
Array.prototype.forEach.call(timestamps, function(el) {
el.innerHTML = el.getAttribute('datetime')
});
}, 1);
@CodeBrauer
CodeBrauer / rustServerScript.sh
Created January 8, 2016 00:18 — forked from Rhagnur/rustServerScript.sh
Angepasstes Skript um Rust Server auf Linux zum laufen zu bekommen
#!/bin/bash
#command to manually start if you want to close this script (do it in screen)
#xvfb-run --auto-servernum --server-args='-screen 0 640x480x24:32' wine RustDedicated.exe -batchmode +rcon.ip 0.0.0.0 +rcon.port "48000" +rcon.password killer +server.hostname "-LINUX RUST-US-Pro Admins-NO WIPE-NEWBS WELCOM-" +server.port "28015" +server.identity "nfo_rust_server1" +server.maxplayers "2000"
#####################################################################################
# Linux script for Rust server installing. #
# Can also be used to update Rust server and steamcmd. #
# Starts a rust server at the end. #
# #
# If you use a sudoers file please execute this command first to get root access: #
# sudo -s #
function getGIF(tag, id) {
document.title = tag.replace('yes', 'ja').replace('no', 'nein').toUpperCase(); // set doc title
superagent // call giphy api
.get('http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=' + tag)
.set('Accept', 'application/json')
.end(function(err, res) {
if (err || !res.ok) {
console.error('API call failed.');
console.log(err);
$$('.collectionChildren .collectionItem').forEach(function(e) {console.log(e.getAttribute('id').replace("sharedfile_", "ServerSubscribedWorkshopItems=")) })