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
curl -X PUT 'http://localhost:9200/_template/template_1' -d '{ | |
"template" : "*", | |
"mappings": { | |
"_default_": { | |
"dynamic_templates": [ | |
{ | |
"string_fields": { | |
"match": "*", | |
"match_mapping_type": "string", | |
"mapping": { |
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
import re | |
# http://atomboy.isa-geek.com/plone/Members/acoil/programing/double-metaphone | |
from metaphone import dm as double_metaphone | |
# get the Redis connection | |
from jellybean.core import redis | |
import models | |
# Words which should not be indexed |
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
yum install gcc make ncurses-devel | |
yum install giflib-devel libjpeg-devel libtiff-devel -y | |
cd /usr/local/src | |
wget http://ftp.gnu.org/pub/gnu/emacs/emacs-24.5.tar.gz | |
tar xzvf emacs-24.5.tar.gz | |
cd emacs-24.5 | |
./configure --without-x --without-selinux | |
make && make install | |
which emacs | |
emacs --version |
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
Apple: http://www.apple.com/support/security/guides/ | |
NSA Guide: http://www.nsa.gov/ia/_files/factsheets/macosx_hardening_tips.pdf | |
Mac Shadows: http://www.macshadows.com/kb/index.php?title=Hardening_Mac_OS_X | |
Univ. Texas: https://wikis.utexas.edu/display/ISO/Mac+OS+X+Server+Hardening+Checklist | |
Center for Internet Security: http://benchmarks.cisecurity.org/en-us/?route=downloads.browse.category.benchmarks.os.unix.osx | |
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/bash | |
# ensure all arguments are there | |
if [ "$#" -ne 3 ]; then | |
echo "Illegal number of parameters!" | |
echo "EXAMPLE USAGE: " $0 " blah.somedomain.com 443 [email protected]" | |
exit | |
fi | |
HOSTNAME=$1 |
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
"""The ucb module contains functions specific to 61A at UC Berkeley.""" | |
import code | |
import functools | |
import inspect | |
import re | |
import sys | |
def main(fn): |
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
function Y(le) { | |
return (function (f) { | |
return f(f); | |
}(function (f) { | |
return le(function (x) { | |
return f(f)(x); | |
}); | |
})); | |
} |
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
// -- server.groovy -- | |
import io.vertx.ext.web.handler.BodyHandler | |
import io.vertx.ext.web.handler.sockjs.BridgeEventType | |
import io.vertx.groovy.core.Vertx | |
import io.vertx.groovy.ext.web.Router | |
import io.vertx.groovy.ext.web.handler.sockjs.SockJSHandler | |
def vertx = Vertx.vertx(); |
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
// jackson 2 => compile 'com.fasterxml.jackson.core:jackson-core:2.6.3' | |
import com.fasterxml.jackson.annotation.JsonInclude; | |
import com.fasterxml.jackson.databind.DeserializationFeature; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import org.codehaus.jackson.map.DeserializationConfig; | |
import java.io.IOException; |
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
#include <iostream> | |
#include <math.h> // for sin() and cos() | |
void getSinCos(double degrees, double &sinOut, double &cosOut) | |
{ | |
// sin() and cos() take radians, not degrees, so we need to convert | |
static const double pi = 3.14159265358979323846; // the value of pi | |
double radians = degrees * pi / 180.0; | |
sinOut = sin(radians); | |
cosOut = cos(radians); |