// jQuery
$(document).ready(function() {
// code
})
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
curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{ | |
"user" : "kimchy", | |
"post_date" : "2009-11-15T14:12:12", | |
"message" : "trying out Elastic Search" | |
}' | |
// {"ok":true,"_index":"twitter","_type":"tweet","_id":"1","_version":1} | |
curl -XPOST localhost:9200/twitter/tweet/1/_update -d '{ | |
"doc": { |
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
<cfscript> | |
function data_uri(fullFilePath, mimeType='image/*') { | |
var contents = fileReadBinary(fullFilePath); | |
var base64contents = toBase64(contents); | |
var returnString = "data:" & mimeType & ";base64," & base64contents; | |
return returnString; | |
} | |
</cfscript> |
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
#!/bin/bash | |
# Place in /usr/share/backup/ | |
# and make executable | |
# chmod 0744 dup-backup.sh | |
# install: | |
# apt-get install duplicity python-gdata python-gobject-2 python-paramiko | |
## Remeber to change Google drive user name and Google drive folder | |
## And change Email | |
# Must run as root for system wide backups |
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
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
daemon off; | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include /usr/local/etc/nginx/mime.types; # Update if necessary |
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
curl -XPOST 'http://localhost:9200/fuzzytest/' -d ' | |
{ | |
settings: { | |
index: { | |
analysis: { | |
analyzer: { | |
default: { | |
type: "custom", | |
tokenizer: "uax_url_email", | |
filter: [ "lowercase" ] |
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
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> | |
<meta name="robots" content="noodp, noydir" /> | |
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com"> | |
<link rel="canonical" href="http://mysite.com/" /> | |
<link rel="stylesheet" href="http://mysite.com/style.css" type="text/css" /> |
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
<cfset Mongo = CreateObject("java","com.mongodb.MongoClient")> | |
<cffunction name="m" returntype="any"> | |
<cfargument name="value" type="any"> | |
<cfif IsJSON(arguments.value)> | |
<cfset local.retrun = CreateObject("java","com.mongodb.util.JSON").parse(arguments.value)> | |
<cfelse> | |
<cfset local.retrun = CreateObject("java","com.mongodb.util.JSON").parse( SerializeJSON(arguments.value) )> | |
</cfif> | |
<cfreturn local.retrun> |
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
function getRootWebSitePath() { | |
var _location = document.location.toString(); | |
var applicationNameIndex = _location.indexOf('/', _location.indexOf('://') + 3); | |
var applicationName = _location.substring(0, applicationNameIndex) + '/'; | |
var webFolderIndex = _location.indexOf('/', _ | |
location.indexOf(applicationName) + applicationName.length); | |
var webFolderFullPath = _location.substring(0, webFolderIndex); | |
return webFolderFullPath; | |
} |