This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
Button, | |
} from 'react-native'; | |
class Ready extends React.Component { | |
render() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javax.net.ssl.SSLSocket; | |
import javax.net.ssl.SSLSocketFactory; | |
import java.io.*; | |
/** Establish a SSL connection to a host and port, writes a byte and | |
* prints the response. See | |
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services | |
*/ | |
public class SSLPoke { | |
public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OpenHAB Heating Example | |
======================== | |
This heating example shows three rooms in my house with 1 radiator valve, 1 temperature sensor per room and a single boiler. It could be adapted for different situations. | |
The rules allow for simple addition of items in rooms as long as they follow the naming convention and have at least a valve, a thermometer, setpoint and a demand switch. | |
The demand switch is purely internal and is used to indicate if the room requires heat or not. All rooms are OR'd together to define the boiler status and each room demand (On/Off) is applied to the radiator valves. | |
It could be more generic for multiple thermometers/valves per room - but it suits my needs for now. If I make it more generic I will update it accordingly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* afindep.c - address family independant networking functions | |
* | |
* nc6 - an advanced netcat clone | |
* Copyright (C) 2002-2006 Chris Leishman <chris _at_ leishman.org> | |
* Copyright (C) 2001-2006 Mauro Tortonesi <mauro _at_ deepspace6.net> | |
* | |
* This program is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bind SSL port with PFS-enabling cipher suite | |
bind :443 ssl crt path_to_certificate no-tls-tickets ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-RC4-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES128-SHA:AES256-SHA256:AES256-SHA:RC4-SHA | |
# Distinguish between secure and insecure requests | |
acl secure dst_port eq 443 | |
# Mark all cookies as secure if sent over SSL | |
rsprep ^Set-Cookie:\ (.*) Set-Cookie:\ \1;\ Secure if secure | |
# Add the HSTS header with a 1 year max-age |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; depends on [org.imgscalr/imgscalr-lib "4.2"] | |
(ns XXX.image | |
(:refer-clojure :exclude [read]) | |
(:require [clojure.java.io :as io]) | |
(:import [org.imgscalr Scalr Scalr$Method Scalr$Mode] | |
[java.awt Image] | |
[java.awt.image RenderedImage BufferedImageOp] | |
[javax.imageio ImageIO ImageWriter ImageWriteParam IIOImage] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FacetValueHash { | |
public static long hash(String input){ | |
try { | |
Adler32 adler32 = new Adler32(); | |
adler32.update(input.getBytes("UTF8")); | |
return adler32.getValue(); | |
} catch (UnsupportedEncodingException e) { | |
throw new NestableRuntimeException(e); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SpringThucydidesJUnitStories extends ThucydidesJUnitStories { | |
@Override | |
public InjectableStepsFactory stepsFactory() { | |
return SpringAutowiringThucydidesStepFactory.withStepsFromPackage(getRootPackage(), configuration()).andClassLoader(getClassLoader()); | |
} | |
public static class SpringAutowiringThucydidesStepFactory extends ThucydidesStepFactory { | |
private static volatile ConfigurableApplicationContext ctx; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.abhinavsarkar.util; | |
/** | |
* A (infinite) Fibonacci number generator. | |
* | |
* @author Abhinav Sarkar | |
*/ | |
public class Fibonacci extends Generator<Integer> { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bzcat access_log-20111103.bz2 | grep "solr-server/select" | sed 's/.* "GET //' | sed 's/ HTTP\/.*//' | sed s/^/http:\\/\\/10.12.2.76/ | wget -i - -O /dev/null |
NewerOlder