Skip to content

Instantly share code, notes, and snippets.

configurations {
jarsIWant
}
dependencies {
jarsIWant ...
}
task copyJarsToWEBINF(type: Sync) {
from configurations.jarsIWant
@darylteo
darylteo / JarExec.java
Last active August 29, 2015 14:10
JarExec task - supporting execution of Jars (i.e. java -jar). Place in buildSrc/src/main/java/org/gradle/api/tasks/JarExec
/*
* Copyright 2011 the original author or authors.
*
* 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
@darylteo
darylteo / upgrade.ps1
Last active August 29, 2015 14:14
Crazy? Lets write a powerscript to upgrade umbraco for us. (WIP duh, but I ain't creating a whole repo for this)
param(
[string]$version,
[string]$target = ".",
[string]$config,
[string]$sitehost,
[string]$dbhost,
[string]$dbname,
[string]$dbuser,
[string]$dbpass,
@darylteo
darylteo / SetParentContentType.sql
Created April 16, 2015 03:39
Stored Procedure T-SQL - Move Document Types in Umbraco 6.2.5
CREATE PROCEDURE SetParentContentType
@childAlias as varchar(MAX),
@parentAlias as varchar(MAX)
AS
BEGIN TRANSACTION;
declare @childId as int;
declare @parentId as int;
SET @childId = (SELECT nodeId FROM cmsContentType WHERE alias = @childAlias);
@darylteo
darylteo / spark.js
Created May 24, 2015 07:32
Custom build of Spark IO - accepts http urls for local cloud connections (some errors were annoying and removed for simplicity)
var es6 = require("es6-shim");
var net = require("net");
var Emitter = require("events").EventEmitter;
var https = require("https");
var http = require("http");
var priv = new Map();
var errors = {
cloud: "Unable to connect to spark cloud.",
@darylteo
darylteo / component.js
Last active October 10, 2016 20:36
Dynamic Component for Ractive with Data propagation on the same level as data source
/*
Extension of the code found at the following SO post
http://stackoverflow.com/questions/31075341/how-to-create-ractives-subcomponents-dynamically-and-change-them-programmatical
*/
let Ractive = require("Ractive");
Ractive.components.dynamic = Ractive.extend({
template: "{{>impl}}",
components: { // you can set whatever components you need, or just use the global ones via Ractive.components },
partials: {
@darylteo
darylteo / ArrayOrObject.java
Last active November 8, 2022 10:48
Jackson Deserializer based on several StackOverflow posts.
import java.util.List;
@Data
public class ArrayOrObject<T> {
private List<T> data;
private Boolean isObject;
}
@darylteo
darylteo / .slate.js
Created January 20, 2017 11:10
slate
var pushRight = slate.operation("push", {
"direction": "right",
"style": "bar-resize:screenSizeX/2"
});
var pushLeft = slate.operation("push", {
"direction": "left",
"style": "bar-resize:screenSizeX/2"
});
@darylteo
darylteo / build.gradle
Created March 15, 2017 02:33
JavaExec Swagger-CodeGen in Gradle
configurations {
swagger
}
repositories {
mavenCentral()
}
dependencies {
swagger 'io.swagger:swagger-codegen-cli:2.2.0'
@darylteo
darylteo / brew.sh
Last active September 12, 2017 12:58
OS X Setup
# install xcode!!!!!! OPEN APP STORE
xcode-select --install
# get slate config
curl https://gist.githubusercontent.com/darylteo/2863d6c91ec8c74305560929c88932bd/raw/9069529777ba4845cd65ed6d9b1cfa678927cec9/.slate.js > ~/.slate.js
# install brew stuff
brew install \
bash-completion \
bash-git-prompt \