Skip to content

Instantly share code, notes, and snippets.

@CodeBrauer
CodeBrauer / main-dark.css
Last active January 11, 2020 22:56
Dark theme for Stikked: https://github.com/claudehohl/Stikked just replace `/static/styles/main.css`
/* Dark theme the for Stikked: https://github.com/claudehohl/Stikked - by https://github.com/GabrielWanzek - version 1.0 */
html {
background: none;
}
body {
background-color: #161F30;
color: #fefefe;
font-family: "Lucida Grande", Tahoma, Verdana, sans-serif;
@CodeBrauer
CodeBrauer / main-dark-3.css
Last active December 15, 2015 08:09
Dark CSS3 theme for Stikked: https://github.com/claudehohl/Stikked just replace `/static/styles/main.css`
@import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz:400,700);
html {
background: none;
}
body {
background-color: #161F30;
color: #fefefe;
font-family: Arial, Tahoma, Verdana, sans-serif;
@CodeBrauer
CodeBrauer / anticacheimg.php
Last active August 29, 2015 13:57
Don't Cache Images - PHP Solution
<!-- This img will be cached. -->
<img src="http://example.com/dynamic_image.png">
<!-- This img will not be cached. -->
<img src="http://example.com/dynamic_image.png?x=<?php echo time(); ?>">
Thats a small little hack to prevent caching images.
@CodeBrauer
CodeBrauer / main.c
Created June 13, 2014 21:35
w7ddpatcher
/*
w7ddpatcher - enable Windows 7 DirectDraw palette compatibility fix for a given
program.
Certain games such as Starcraft 1, Warcraft 2 BNE, Age of Empires, Diablo 1,
and others suffer from a "rainbow glitch", when some other program modifies
global Windows color palette while the game is running, causing some objects to
be rendered with wrong colors. Most often this program is Explorer.exe, so
killing it before starting the game usually fixes the glitch, but it is
annoying to do.
@CodeBrauer
CodeBrauer / cart_helper.php
Last active August 29, 2015 14:04
Some helper functions for CodeIgniter Cart Library. With this functions you can get all ids of your cart and also check if the id is in the cart.
<?php
/* cart helper */
function is_item_in_cart($id) {
return in_array($id, get_cart_item_ids());
}
function get_cart_item_ids() {
$CI =& get_instance();
@CodeBrauer
CodeBrauer / convert_px_to_cm.php
Created July 31, 2014 10:39
Converts px to cm (with DPI) and variable precision
<?php
function get_cm_by_px($px, $dpi = 300, $precision = 2) {
$comma = ','; // if US use '.'
return number_format(2.54 * $pic->exif->size->height / $dpi , $precision, $comma,'') ;
}
@CodeBrauer
CodeBrauer / Gitlab.class.php
Created February 3, 2015 16:15
Super simple gitlab library
<?php
/**
* super simple gitlab api
*/
class Gitlab
{
const API_URL = 'http://gitlab.local/';
const PRIVATE_TOKEN = 'XXXXXXXXXXXXXXXXXXX';
public static function get($method, $param = '', $json_encode = true, $show_error = false) {
@CodeBrauer
CodeBrauer / GMGetCoordinates.php
Last active March 26, 2019 12:42
get coordinates from address with google maps api
<?php
function GMGetCoordinates($address) {
$address = urlencode($address);
$url = "http://maps.google.com/maps/api/geocode/json?address=$address&sensor=false";
$ch = curl_init();
$options = array(
CURLOPT_SSL_VERIFYPEER => false,
@CodeBrauer
CodeBrauer / install-bolt.command
Last active August 29, 2015 14:18
mac os command script to install fastly bolt - just put in your htdocs/public_html and run it.
#!/bin/bash
# installs bolt cms to the path and opens the browser.
# works currently only on Mac OS X
# v0.2 @CodeBrauer
cd "$( dirname "${BASH_SOURCE[0]}" )"
clear
@CodeBrauer
CodeBrauer / cron_db_backup.sh
Last active August 29, 2015 14:18
super simple mysql backup script with mysqldump
#!/bin/bash
cd /_backups
HOST="1.2.3.4"
USER="my_backup_user"
PASS="**************"
DATE_TODAY=$(date +"%Y-%m-%d")