Skip to content

Instantly share code, notes, and snippets.

View Rudis1261's full-sized avatar

Rudi Strydom Rudis1261

View GitHub Profile
@Rudis1261
Rudis1261 / serve.py
Created August 24, 2016 07:13 — forked from chrisbolin/serve.py
Python SimpleHTTPServer for Static Serving (React / Angular / Ember) in HTML5 mode (a la mod_rewrite)
'''
Taken from:
http://stackoverflow.com/users/1074592/fakerainbrigand
http://stackoverflow.com/questions/15401815/python-simplehttpserver
'''
import SimpleHTTPServer, SocketServer
import urlparse, os
PORT = 3000
@Rudis1261
Rudis1261 / gist:552a841bf15b19c01c0014b8038ec145
Created July 5, 2016 08:35
Configurações para o Sublime como IDE para PHP / JS
Instale no Ubuntu usando a build 3083 para que a licenca funcione com o comando abaixo para 64 bits:
wget http://c758482.r82.cf2.rackcdn.com/sublime-text_build-3083_amd64.deb
sudo dpkg -i sublime-text_build-3083_amd64.deb
Ou
cd /opt
wget wget http://c758482.r82.cf2.rackcdn.com/sublime_text_3_build_3083_x64.tar.bz2
tar -jxvf sublime_text_3_build_3083_x64.tar.bz2
alert("Hello Casta");
@Rudis1261
Rudis1261 / check_certificate_validity.php
Last active September 2, 2021 14:49
A PHP Script to check a host's certificate validity, and automatically renew it. Using https://letsencrypt.org/
#!/usr/bin/env php
<?php
error_reporting(-1);
ini_set('displayErrors', 1);
echo PHP_EOL . PHP_EOL ."====================START=========================";
echo PHP_EOL . "RUN ON:\t\t\t\t" . date('d M Y G:i', time()) . PHP_EOL;
// Check the host
@Rudis1261
Rudis1261 / index.php
Created May 16, 2016 20:46
Simple PHP Puller
<?php
ini_set('display_errors', 1);
error_reporting(-1);
$lines = explode(PHP_EOL, file_get_contents('source.txt'));
$dir = 'vids';
if (!file_exists($dir)) {
mkdir($dir);
}
@Rudis1261
Rudis1261 / no_touch_highlight.css
Created April 29, 2016 13:05
Just a couple of properties for mobiles.
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
-webkit-text-size-adjust: none;
-moz-text-size-adjust: none;
-ms-text-size-adjust: none;
-o-text-size-adjust: none;
@Rudis1261
Rudis1261 / nginx.conf
Created March 22, 2016 11:20 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@Rudis1261
Rudis1261 / email-obfuscate.js
Created November 13, 2015 13:24
Obfuscate That Email Address YO
// Used to Obfuscate a email address on a page.
// Try and stop the bot attacks
var username = "john.doe";
var hostname = "example.com";
var linktext = username + "@" + hostname ;
document.write("<a style='color:white;' href='" + "mail" + "to:" + linktext + "'>" + linktext + "</a>");
@Rudis1261
Rudis1261 / jsmin.php
Last active August 29, 2015 14:25
PHP minify JS somewhat.
#!/bin/env php
<?php
$fileName = 'test.js';
$outputFileName = 'test-out.js';
if (file_exists($fileName)) {
var_dump("FROM IO");
$test = file_get_contents($fileName);
} else {
@Rudis1261
Rudis1261 / test.php
Created July 15, 2015 14:57
Just creating a quick test to ensure that a float gets converted to the correct INT value expected by SnapScan
<?php
$amount = (!empty($_GET['amount'])) ? $_GET['amount'] : 50;
$amount = $amount * 100;
$amount = (int)$amount;
$merchant = (!empty($_GET['merchant'])) ? $_GET['merchant'] : 'snapTest';
header("location:https://pos.snapscan.io/qr/{$merchant}?amount={$amount}&id=TestingTheAccount&strict=true");