Skip to content

Instantly share code, notes, and snippets.

@basdenooijer
basdenooijer / demo.php
Created May 4, 2011 06:26
Solarium example with facet filtering and pagination
<?php
require('../library/Solarium/Autoloader.php');
Solarium_Autoloader::register();
$client = new Solarium_Client();
$client->setHost('192.168.1.2');
$client->setCore('geonames');
$query = new Solarium_Query_Select;
@avoine
avoine / gist:2912777
Created June 11, 2012 21:19
Bridge to send rsyslog logs to sentry (http://www.getsentry.com)
#!/usr/bin/env python
#
# Copyright 2012 Patrick Hetu <patrick.hetu@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
<?php
/*
Plugin Name: Urejevalnik
Description: Tabela, znaki itd
Author: Janez Troha
Version: 1.0
Author URI: http://www.dz0ny.info
*/
function fb_change_mce_buttons( $initArray ) {
@Vheissu
Vheissu / functions.php
Created October 22, 2012 02:36
Bundling the Advanced Custom Fields plugin into a theme using the TGM Plugin Class
add_action( 'tgmpa_register', 'register_required_plugins' );
// This function is called from the above hook
function register_required_plugins()
{
// The plugins array allows us to define multiple plugins we want to include.
// The commented out example shows how we can include and activation a bundled
// plugin zip file in our theme.
$plugins = array(
/* array(
/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .lt-ie9 .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }

Make it real

Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.

Ship it

Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.

Do it with style

@willurd
willurd / web-servers.md
Last active June 24, 2024 11:36
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@acka47
acka47 / serendipity-only-orgs
Created February 12, 2014 10:15
orgs described in serendipity map data that aren't part of OCW consortium
{
"consortiumURL" : "http://www.universia.net/",
"ocwURL" : "Flamenco?q=UniversityName:33&group=UniversityName",
"universityContinent" : "North America",
"universityLogo" : "http://www.anahuac.mx/images/stories/contenido/la_universidad/logo_universidad_anahuac_chico.gif",
"universityOCWURL" : "http://educommons.anahuac.mx:8080/eduCommons/",
"universityURL" : "http://www.anahuac.mx/",
"universityCountry" : "Mexico",
"universityURI" : "http://dbpedia.org/resource/Universidad_An%C3%A1huac_M%C3%A9xico_Norte",
"universityLong" : "-99.267674",
@mosne
mosne / gist:75b3ce1f0098663f2b1a
Last active August 17, 2018 18:37
Migrate images form a Magic Fields to ACF (inside a wordpress loop)
<?php
$photo_name = get_field("cover");
if ($photo_name != "") {
$ff = '/Users/mosne/Sites/Dropbox/mosne.local/wp-content/files_mf/' . $photo_name;
$handle = fopen($ff, "r");
$ffcontents = fread($handle, filesize($ff));
$attachment = wp_upload_bits($photo_name, null, $ffcontents);
@rafibomb
rafibomb / 2-column-stacking
Created November 15, 2014 01:20
2 Column Stacking Inline Links on Mobile - Ink Responsive HTML Email
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width"/>
<link rel="stylesheet" href="ink.css"> <!-- For testing only -->
<link type="text/css" rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/foundicons/3.0.0/foundation-icons.css" />
<style type="text/css">