Skip to content

Instantly share code, notes, and snippets.

@elpete
elpete / cfml-general-log.md
Last active January 23, 2016 18:06 — forked from anonymous/cfml-general-log.txt
Slack Chat about OOP in CFML

OOP in CFML Discussion

CFML Slack

January 14, 2016

Unrelated messages omitted for brevity.

Punctuation and spelling not touched.

tbrown [11:14 AM]

@juliandunn
juliandunn / post-mortem-template.md
Created April 29, 2015 00:53
Post mortem template

INCIDENT DATE - INCIDENT TYPE

Meeting

Waiving meetings

In some cases the IC might determine that a PM meeting for the incident isn't needed. If the IC decides to waive the meeting please replace the Meeting section with a note indicating the meeting has been waived (example: Meeting waived: Paul Mooring)

@abyx
abyx / angular-error-handling.js
Last active February 4, 2022 19:19
AngularJS HTTP Error Handling Mechanism
var HEADER_NAME = 'MyApp-Handle-Errors-Generically';
var specificallyHandleInProgress = false;
angular.module('myApp').factory('RequestsErrorHandler', ['$q', function($q) {
return {
// --- The user's API for claiming responsiblity for requests ---
specificallyHandled: function(specificallyHandledBlock) {
specificallyHandleInProgress = true;
try {
return specificallyHandledBlock();
@idosela
idosela / http-response-interceptor.js
Last active February 25, 2024 12:51
Sample code for ng-conf 2014
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) {
$httpProvider.responseInterceptors.push([
'$q', '$templateCache', 'activeProfile',
function($q, $templateCache, activeProfile) {
// Keep track which HTML templates have already been modified.
var modifiedTemplates = {};
// Tests if there are any keep/omit attributes.
var HAS_FLAGS_EXP = /data-(keep|omit)/;
@evanwong
evanwong / elasticsearch java completion suggest
Created September 10, 2013 15:46
elasticsearch java client to query a completion suggest v0.90.3
String clusterName = "testcluster";
String indexName = "textindex";
String suggestionName = "suggestion";
NodeBuilder nodeBuilder = NodeBuilder.nodeBuilder().clusterName(clusterName).client(true);
Node node = nodeBuilder.node();
try {
Client client = node.client();
CompletionSuggestionBuilder completionSuggestionBuilder = new CompletionSuggestionBuilder(suggestionName);
SuggestResponse suggestionRes = client.prepareSuggest(indexName).setSuggestText("tes").addSuggestion(completionSuggestionBuilder.field("suggest")).execute().actionGet();
Suggest suggest = suggestionRes.getSuggest();
@jamesmacaulay
jamesmacaulay / profiles.clj
Last active November 15, 2023 01:18
My ~/.lein/profiles.clj at the moment.
{:user {:dependencies [[org.clojure/tools.namespace "0.2.3"]
[spyscope "0.1.3"]
[criterium "0.4.1"]]
:injections [(require '(clojure.tools.namespace repl find))
; try/catch to workaround an issue where `lein repl` outside a project dir
; will not load reader literal definitions correctly:
(try (require 'spyscope.core)
(catch RuntimeException e))]
:plugins [[lein-pprint "1.1.1"]
[lein-beanstalk "0.2.6"]
@jamesmacaulay
jamesmacaulay / Clojure.sublime-settings
Last active January 18, 2021 19:01
Clojure stuff for Sublime Text 2. Files live in ~/Application Support/Sublime Text 2/Packages/User
// installed Clojure packages:
//
// * BracketHighlighter
// * lispindent
// * SublimeREPL
// * sublime-paredit
{
"word_separators": "/\\()\"',;!@$%^&|+=[]{}`~?",
"paredit_enabled": true,
@markmandel
markmandel / FutureThreadedWorker.cfc
Created November 26, 2012 03:58
FutureThreadedWorker
<!---
Copyright 2012 Mark Mandel
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
@adamcameron
adamcameron / ClassViewer.cfc
Created August 7, 2012 18:28
An almost pure CFML implementation of ClassViewer.class (see http://adamcameroncoldfusion.blogspot.co.uk/2012/08/classviewerjava.html).
/**
ClassViewer.cfc
@hint An almost pure CFML implementation of ClassViewer.class (see http://adamcameroncoldfusion.blogspot.co.uk/2012/08/classviewerjava.html).
@description
*/
component {
// these are just for formatting the output
variables._NL = createObject("java", "java.lang.System").getProperty("line.separator");
variables._INDENT = " ";
@adamcameron
adamcameron / ClassViewer.java
Created August 7, 2012 07:11
ClassViewer uses Java reflection to generate a text report of a class's structure and behaviours (http://bit.ly/QzT9ZX)
import java.util.*;
import java.lang.reflect.*;
public class ClassViewer
{
private static final String nl = System.getProperty("line.separator");
public static final String viewClassByName(String name)
throws Exception
{