Skip to content

Instantly share code, notes, and snippets.

View jlauding's full-sized avatar

Janne jlauding

  • Producks AB
  • Sweden
View GitHub Profile
@matula
matula / awesm.md
Last active February 19, 2024 16:23
Awesome PHP stuff in one Gist
# ----------------------------------------------------------------------
# 5G BLACKLIST/FIREWALL (2013)
# @ http://perishablepress.com/5g-blacklist-2013/
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# 5G:[QUERY STRINGS]
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
@thomseddon
thomseddon / gist:4703810
Last active December 27, 2016 02:58 — forked from nobuf/gist:3419910
Supporting placeholder on IE9 with AngularJS (without jQuery) > Removed jQuery dependency > Slight optimisation in retrieving placeholder text
angular.module('test', [])
.directive('placeholder', function($timeout){
var i = document.createElement('input');
if ('placeholder' in i) {
return {}
}
return {
link: function(scope, elm, attrs){
if (attrs.type === 'password') {
return;
@jenheilemann
jenheilemann / sub-page-navigation-widget.php
Last active September 18, 2017 15:37
Controlled through the Widget menus. It adds sub-page navigation automatically
<?php
/*
Sub-Page Navigation Widget
Controlled through the Widget menus.
It adds sub-page navigation automatically.
It has no options.
*/
class SubPage_Navigation_Widget extends WP_Widget {
@olivierlacan
olivierlacan / An_example.markdown
Created February 18, 2012 05:40 — forked from renz45/An_example.markdown
Re-style Sublime Text 2 sidebar to a darker theme

This re-styles your sublime text 2 sidebar to be darker, so it doesn't blind you when using a dark theme.

Dark sublime text 2 sidebar

Save the Default.sublime-theme file into packages/Theme - Default, make a backup of your original if you want to be able to go back easily.

@viktorkelemen
viktorkelemen / Custom canvas google maps marker
Created December 9, 2011 15:21
Creating a custom google maps marker with canvas
<!DOCTYPE html>
<html>
<head>
<style>
html {
width: 100%;
height: 100%;
}
body {
@robflaherty
robflaherty / csv-to-json.php
Created September 1, 2011 02:26
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed
@jheitzeb
jheitzeb / gist:1104924
Created July 25, 2011 19:15
Google Docs Survey Emailer
function onFormSubmit(e) {
var to_email = "YOUREMAIL@YOURCOMPANY.COM";
var ss = SpreadsheetApp.getActiveSpreadsheet();
var spreadsheet_name = ss.getName();
var sheet = ss.getSheets()[0];
var columns = sheet.getRange("A1:U1").getValues()[0];
var email_subject = "New response for [" + spreadsheet_name + "]";
var email_body = "Spreadsheet: " + spreadsheet_name + "\r\n\r\n";
var email_body_html = "<p><b>Spreadsheet: " + spreadsheet_name + "</b></p>";
@cowboy
cowboy / finder-open-iterm-here.scpt
Created April 6, 2011 12:10
Finder Open iTerm Here: Drop a folder on this script (or just run it) to open a new iTerm window there. If the selected item isn't a folder, it will open the item's parent folder. Great when bound to a hotkey in FastScripts or added to the Finder Sidebar
(*
* Finder Open iTerm Here - v1.0.2 - 4/14/2011
* http://benalman.com/
*
* Copyright (c) 2011 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*)
tell application "Finder"