Skip to content

Instantly share code, notes, and snippets.

import RxSwift
// trick to get a clean unwrap optional by creating an intermediate type
protocol Optionable {
associatedtype Wrapped
var value: Wrapped? { get }
}
extension Optional : Optionable {
var value: Wrapped? { return self }
@CedricGatay
CedricGatay / presence.sh
Created May 23, 2017 19:06
Presence detection using https://github.com/CedricGatay/asuswrt-presence for asus wrt network presence scanning
#!/bin/bash
AUTH=AUTHTOKEN;
ASUSWRTPRESENCEIP=IP;
DOMOTICZ_IP=IP;
DOMOTICZ_PORT=PORT;
curl --silent http://$ASUSWRTPRESENCEIP:9090 > devices
function checkPresence {
@CedricGatay
CedricGatay / Jenkinsfile.cleanup
Created May 22, 2017 12:39
Workspaces cleanup Jenkinsfile
import hudson.model.*;
import hudson.util.*;
import jenkins.model.*;
import hudson.FilePath.FileCallable;
import hudson.slaves.OfflineCause;
import hudson.node_monitors.*;
node('master'){
stage('Cleanup nodes'){
@CedricGatay
CedricGatay / isilis_be_cfonb.cfonb
Created March 27, 2017 08:10
Isilis BE test cfonb file
CFONB FILE

Keybase proof

I hereby claim:

  • I am CedricGatay on github.
  • I am cedricgatay (https://keybase.io/cedricgatay) on keybase.
  • I have a public key whose fingerprint is 262E B7FB 9A44 F248 EA73 0362 3F06 F893 DF33 D566

To claim this, I am signing this object:

@CedricGatay
CedricGatay / 85-typematrix.rules
Created September 1, 2015 12:03
Colemak via udev
ACTION=="add", ATTR{idVendor}=="1e54", ATTR{idProduct}=="2030", RUN+="/usr/local/bin/set_typematrix_colemak_mapping"
@CedricGatay
CedricGatay / gist:055877128a3bf554f3f6
Created February 26, 2015 09:09
gcm-repository-maven-fragment.xml
<repositories>
<repository>
<id>gcm-server-repository</id>
<url>https://github.com/slorber/gcm-server-repository/raw/master/releases/</url>
</repository>
</repositories>
@CedricGatay
CedricGatay / strip_play_services.gradle
Last active August 29, 2015 14:09 — forked from dmarcato/strip_play_services.gradle
Keep track of previous run to prevent restripping if nothing has changed
// adapted from https://gist.github.com/dmarcato/d7c91b94214acd936e42
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}

Keybase proof

I hereby claim:

  • I am CedricGatay on github.
  • I am cedricgatay (https://keybase.io/cedricgatay) on keybase.
  • I have a public key whose fingerprint is 8093 1796 FBFE 2411 B963 2CBD 44FA BF6E 6113 22F8

To claim this, I am signing this object:

@CedricGatay
CedricGatay / gist:10872358
Created April 16, 2014 13:11
distassembly
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
<id>ui-dist</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>