# start a screen with a sessionname
screen -S sessionname
# list screens
screen -ls
# attach to a detached screen
screen -r [sessionid]
This file contains 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
#!/bin/sh | |
# | |
# openresty adapted script to start and stop the openresty compiled | |
# nginx daemon | |
# --- original nginx comment --- | |
# nginx - this script starts and stops the nginx daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ |
This file contains 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
<html> | |
<body>first test</body> | |
</html> |
This file contains 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
@Singleton | |
public class AppAuthRequest implements AuthRequest<User>{ | |
@Inject | |
private UserDao userDao; | |
@Override | |
public AuthToken<User> authRequest(RequestContext rc) { | |
AuthToken<User> authToken = null; | |
This file contains 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
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>APP_BASE_PACKAGE</groupId> | |
<artifactId>APP_NAME</artifactId> | |
<packaging>war</packaging> | |
<version>0.1</version> | |
<name>APP_NAME</name> | |
<url>http://maven.apache.org</url> | |
This file contains 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
/** | |
* Just for fun, hacking Dualshock4 with node.js | |
* Most of the code comes from https://npmjs.org/package/dualshock-controller | |
* Just wanted to play with the low level hid protocol. | |
* Next step: EV3 Control via Bluetooth with Dualshock4 (PC still required). | |
* Future step: EV3 node.js onboarding with Dualshock4 remote control (Autonomous). | |
*/ | |
var HID = require('node-hid'); | |
This file contains 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
// Just a little indirection to render a template using handlebars. | |
// This simple indirection allows much flexibility later one, | |
// when using pre-compiling or other templating engine are needed. | |
Handlebars.templates = Handlebars.templates || {}; | |
function render(templateName,data){ | |
var tmpl = Handlebars.templates[templateName]; | |
if (!tmpl){ | |
tmpl = Handlebars.compile($("#" + templateName).html()); | |
Handlebars.templates[templateName] = tmpl; | |
} |
This file contains 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
List<String> names = Arrays.asList("one","two ","three"); | |
// fancy builtin collector with delimiter | |
String s = names.stream().collect(Collectors.joining(", ")); | |
System.out.println(s); | |
// "one, two , three" | |
// name elements does not get trimmed, so, need custom. | |
// Let's see how we can get there with the custom collector collect(supplier,accumulator,multiplier) |
This file contains 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 com.britecrm.util; | |
import com.fasterxml.jackson.core.JsonGenerator; | |
import com.fasterxml.jackson.core.JsonParser; | |
import com.fasterxml.jackson.core.JsonProcessingException; | |
import com.fasterxml.jackson.core.ObjectCodec; | |
import com.fasterxml.jackson.databind.*; | |
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | |
import com.fasterxml.jackson.databind.module.SimpleModule; |
This file contains 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
// | |
// Future.swift | |
// | |
// Experimental simple Future/Promise class in Swift 2 (Beta) | |
// | |
// NEXT: probably want to split the promise (done/fail) from the future part (the resolve/reject) | |
// | |
// Jeremy Chone 2015-06-21 | |
import Foundation |
OlderNewer