Skip to content

Instantly share code, notes, and snippets.

View RxSwift+Tools.swift
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
Presence detection using https://github.com/CedricGatay/asuswrt-presence for asus wrt network presence scanning
View presence.sh
#!/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
Workspaces cleanup Jenkinsfile
View Jenkinsfile.cleanup
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'){
View keybase.md

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:

View 85-typematrix.rules
ACTION=="add", ATTR{idVendor}=="1e54", ATTR{idProduct}=="2030", RUN+="/usr/local/bin/set_typematrix_colemak_mapping"
@CedricGatay
CedricGatay / gist:055877128a3bf554f3f6
Created Feb 26, 2015
gcm-repository-maven-fragment.xml
View gist:055877128a3bf554f3f6
<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 Aug 29, 2015 — forked from dmarcato/strip_play_services.gradle
Keep track of previous run to prevent restripping if nothing has changed
View strip_play_services.gradle
// adapted from https://gist.github.com/dmarcato/d7c91b94214acd936e42
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
View keybase.md

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:

View gist:10872358
<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>
You can’t perform that action at this time.