Skip to content

Instantly share code, notes, and snippets.

View mkober's full-sized avatar

Mark Koberlein mkober

View GitHub Profile
@mkober
mkober / .vimrc.after
Created January 17, 2012 03:59
.vimrc.after
color desert
hi Cursorline cterm=bold
set cursorline
@mkober
mkober / .tmux.conf
Created January 17, 2012 04:02
.tmux.conf
# Make it use C-a, similar to screen..
# unbind C-b
# unbind l
# set -g prefix C-a
# bind-key C-a last-window
# Reload key
bind r source-file ~/.tmux.conf
unbind Right
@mkober
mkober / gist:1820269
Created February 13, 2012 20:47
Ways to prevent SQL Injections in PHP (for LV PHP Meetup)
// Ways to prevent SQL Injections in PHP (http://php.net/manual/en/security.database.sql-injection.php)
1. "Never connect to the database as a superuser or as the database owner. Use always customized users with very limited privileges."
2. "Check if the given input has the expected data type. PHP has a wide range of input validating functions, from the simplest ones found in Variable Functions and in Character Type Functions" (e.g. is_numeric(), ctype_digit()
3. "Quote each non numeric user supplied value that is passed to the database with the database-specific string escape function" (e.g. mysql_real_escape_string(), sqlite_escape_string(), etc.). "If a database-specific string escape mechanism is not available, the addslashes() and str_replace() functions may be useful (depending on database type)."
<?php
@mkober
mkober / generate-php-ctags
Created December 12, 2012 04:00
Generate PHP ctags
ctags -f .tags \
-h \".php\" -R \
--exclude=\"\.git\" \
--totals=yes \
--tag-relative=yes \
--PHP-kinds=+cf \
--regex-PHP='/abstract class ([^ ]*)/\1/c/' \
--regex-PHP='/interface ([^ ]*)/\1/c/' \
--regex-PHP='/(public |static |abstract |protected |private )+function ([^ (]*)/\2/f/'
@mkober
mkober / gist:6889412
Created October 8, 2013 18:37
Maya X-Ray on Selected Objects
global proc r_superXray()
{
string $select[] = `ls -sl`;
int $sizes = `size$select`;
if ($sizes >= 1)
{
string $mySel[] = `ls -sl -dag -s`;
for ($s in $mySel)
@mkober
mkober / designer.html
Created July 30, 2014 20:44
designer
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
<style>
#core_scaffold {
position: absolute;
top: 0px;
right: 0px;
// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)
@mkober
mkober / .gitignore
Created February 17, 2017 17:35
.gitignore for WordPress - originally written by @salcode
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20160309
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
# Recursively add a .keep file in order to track empty folders in git
find . -type d -exec touch {}/.keep \;
cd /Library/Preferences
sudo rm com.sophos.sav.plist

cd /Library/Application\ Support/Sophos/cloud/Installer.app/Contents/MacOS/tools/
sudo ./InstallationDeployer —force_remove