Skip to content

Instantly share code, notes, and snippets.

View nickcernis's full-sized avatar

Nick Cernis nickcernis

  • Innsbruck, Austria
  • 20:35 (UTC +02:00)
View GitHub Profile
@caseyamcl
caseyamcl / come-on-really.md
Created February 19, 2015 18:20
Ahhhhhhhhh!!!!

HOLY GAWD PEOPLE..

  • Don't write all your new code on the production machine!
  • Use a VCS!
  • Document your functions using DocBlocks!
  • Document your API (at least LIST the endpoints)... I have to decipher the meaning from your code, and that isn't really clear
  • Use a single identifier as the primary ID in the API for a resource (ie don't return a list of group ids for listing groups and then expect the group name as the identifying parameter for modifying a group)
  • Use a consistent model for representing the same data model in different endpoints!
  • Don't concatenate fields in the API results unless there is a good reason to (e.g first name and last name)
  • Don't expose the underlying database logic. This is leaky abstraction, especially when you do it inconsistently!!
@md5
md5 / 00_README.md
Last active March 20, 2024 00:19
Demonstration Docker config for Wordpress on PHP-FPM behind Nginx

Proof of concept setup for Wordpress running under PHP-FPM with an Nginx frontend

Usage

Build a copy of this image:

git clone git://github.com/d9206eacb5a0ff5d6be0.git docker-nginx-fpm
cd docker-nginx-fpm
docker build -t nginx-fpm .
@darekkay
darekkay / intellij-monokai-theme.xml
Last active March 5, 2021 09:47
Monokai Theme for JetBrains IDEs (IntelliJ IDEA, Webstorm, PhpStorm, PyCharm etc.)
<scheme name="Eclectide Monokai" version="142" parent_scheme="Default">
<colors>
<option name="ADDED_LINES_COLOR" value="295622" />
<option name="ANNOTATIONS_COLOR" value="b2c0c6" />
<option name="CARET_COLOR" value="bbbbbb" />
<option name="CARET_ROW_COLOR" value="" />
<option name="CONSOLE_BACKGROUND_KEY" value="1c1c1c" />
<option name="FILESTATUS_ADDED" value="629755" />
<option name="FILESTATUS_DELETED" value="6c6c6c" />
<option name="FILESTATUS_IDEA_FILESTATUS_DELETED_FROM_FILE_SYSTEM" value="6c6c6c" />
@Rarst
Rarst / WordPress.xml
Last active August 5, 2021 04:14
WordPress Live Templates for PhpStorm
<?xml version="1.0" encoding="UTF-8"?>
<templateSet group="WordPress">
<template name="aa" value="add_action( '$hook$', '$callback$' );&#10;$END$" description="add_action" toReformat="false" toShortenFQNames="true">
<variable name="hook" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="callback" expression="" defaultValue="" alwaysStopAt="true" />
<context>
<option name="HTML_TEXT" value="false" />
<option name="HTML" value="false" />
<option name="XSL_TEXT" value="false" />
<option name="XML" value="false" />
@jasonlong
jasonlong / vimium-styling.md
Last active January 29, 2024 21:37
Nicer Vimium link hint styling. What's Vimium? See http://vimium.github.io. This awesome yellow is courtesy of @mrmrs colors: http://clrs.cc.

@sskylar
sskylar / imgix.html
Created October 15, 2014 21:19
Using imgix with Siteleaf
{{ asset.url | prepend:'//you.imgix.net' | append:'?w=500&h=500' }}
@staltz
staltz / introrx.md
Last active May 3, 2024 13:00
The introduction to Reactive Programming you've been missing
@maxrice
maxrice / gist:6541634
Last active April 23, 2020 18:11
WooCommerce - sort the cart alphabetically by the product's title
<?php
add_action( 'woocommerce_cart_loaded_from_session', function() {
global $woocommerce;
$products_in_cart = array();
foreach ( $woocommerce->cart->cart_contents as $key => $item ) {
$products_in_cart[ $key ] = $item['data']->get_title();
}
@mathie
mathie / binding.clj
Created September 7, 2013 09:02
Demonstrating late binding in Clojure for @mr_urf
user=> (def foo 'hello)
#'user/foo
user=> (defn bar [] foo)
#'user/bar
user=> (bar)
hello
user=> (def foo 'world)
#'user/foo
user=> (bar)
world
@UtahDave
UtahDave / mult-line cmd.run
Last active December 20, 2015 11:39
Multi-line cmd.run wget->tar->rm->cd->make
'''
Redhost functionality
'''
# Import salt libs
import salt.utils
def install_redis():
'''