To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion
#!/bin/sh | |
# check for where the latest version of IDEA is installed | |
IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1` | |
wd=`pwd` | |
# were we given a directory? | |
if [ -d "$1" ]; then | |
# echo "checking for things in the working dir given" | |
wd=`ls -1d "$1" | head -n1` |
IE6 Only | |
================== | |
_selector {...} | |
IE6 & IE7 | |
================== | |
*html or { _property: } | |
IE7 Only | |
================== |
public void printClientInfo(HttpServletRequest request) { | |
final String referer = getReferer(request); | |
final String fullURL = getFullURL(request); | |
final String clientIpAddr = getClientIpAddr(request); | |
final String clientOS = getClientOS(request); | |
final String clientBrowser = getClientBrowser(request); | |
final String userAgent = getUserAgent(request); | |
logger.info("\n" + |
// @see https://stackoverflow.com/questions/1327074/how-to-execute-in-sql-queries-with-springs-jdbctemplate-effectivly | |
Set<Integer> ids = ...; | |
MapSqlParameterSource parameters = new MapSqlParameterSource(); | |
parameters.addValue("ids", ids); | |
List<Foo> foo = getJdbcTemplate().query("SELECT * FROM foo WHERE a IN (:ids)", | |
parameters, getRowMapper()); |
package com.example.repository | |
import com.example.domain.Customer | |
import org.apache.ibatis.annotations.Delete | |
import org.apache.ibatis.annotations.Insert | |
import org.apache.ibatis.annotations.Mapper | |
import org.apache.ibatis.annotations.Param | |
import org.apache.ibatis.annotations.Select | |
import org.apache.ibatis.annotations.SelectKey | |
import org.apache.ibatis.annotations.Update |
#ack is a tool like grep, designed for programmers with large trees of heterogeneous source code | |
#to install ack, see http://betterthangrep.com/ | |
#to use ack, launch terminal (mac osx) and type 'ack <some_keywords>' | |
#ack will search all files in the current directory & sub-directories | |
#here's how I have my config file setup. this file is located on mac osx here | |
# ~/.ackrc | |
# Always sort the files |
server { | |
listen 80; | |
server_name localhost; | |
root /Users/YOUR_USERNAME/Sites; | |
access_log /Library/Logs/default.access.log main; | |
location / { | |
include /usr/local/etc/nginx/conf.d/php-fpm; | |
} |
To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time.
This procedure is tested on Mac OS X 10.12.5 with Developpers tools installed (xCode).
PHP 7.1 installed with Homebrew.
Download the following files from Oracle website (yes, you need to create an account and accept terms):
public abstract class EdpMongoUtil { | |
/** | |
* @param objectId ObjectId of MongoDB | |
* @return time of java.time.Instant | |
*/ | |
public static Instant timeFromObjectId(String objectId) { | |
return Instant.ofEpochMilli(Integer.parseInt(objectId.substring(0, 8), 16) * 1000); | |
} |