Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,| #!/bin/bash | |
| #### This script is published by Philipp Klaus <[email protected]> | |
| #### on <http://blog.philippklaus.de/2011/05/ipv6-6in4-tunnel-via-hurricane-electric-tunnelbroker-net-automatic-ip-update-on-mac-os-x/> | |
| #### It is originally by freese60 and modified by limemonkey. | |
| #### Found on <http://www.tunnelbroker.net/forums/index.php?topic=287.0> | |
| ### Uncomment this line to debug the script: | |
| #set -x |
| #import <Foundation/Foundation.h> | |
| @interface FOOPSDWriter : NSObject { | |
| NSMutableData *data_; | |
| NSUInteger location_; | |
| } | |
| - (void) writeInt64:(UInt64)value; | |
| - (void) writeInt32:(UInt32)value; |
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
| // Yeah, global variables suck, but it's kind of a necessary evil here | |
| AudioUnit *audioUnit = NULL; | |
| float *convertedSampleBuffer = NULL; | |
| int initAudioSession() { | |
| audioUnit = (AudioUnit*)malloc(sizeof(AudioUnit)); | |
| if(AudioSessionInitialize(NULL, NULL, NULL, NULL) != noErr) { | |
| return 1; | |
| } |
| // | |
| // CLLocation+Sino.h | |
| // | |
| // Created by [email protected] on 13-4-26. | |
| // 火星坐标系转换扩展 | |
| // | |
| // earth(国外 WGS84), mars(国内 GCJ-02), bearPaw(百度 BD-09) 坐标系间相互转换 | |
| // 未包含 mars2earth. 需要这个可参考 http://xcodev.com/131.html | |
| #import <CoreLocation/CoreLocation.h> |
| @implementation UITextView (RSExtras) | |
| static BOOL stringCharacterIsAllowedAsPartOfLink(NSString *s) { | |
| /*[s length] is assumed to be 0 or 1. s may be nil. | |
| Totally not a strict check.*/ | |
| if (s == nil || [s length] < 1) | |
| return NO; |
Note: This was written using elasticsearch 0.9.
Elasticsearch will automatically create an index (with basic settings and mappings) for you if you post a first document:
$ curl -X POST 'http://localhost:9200/thegame/weapons/1' -d \
'{
"_id": 1,| // ==UserScript== | |
| // @name eCalcHack | |
| // @namespace froller | |
| // @description Adding capabilities of registered users of eCalc to everyone | |
| // @include http://www.ecalc.ch/motorcalc.php* | |
| // @include http://www.ecalc.ch/xcoptercalc.php* | |
| // @include http://www.ecalc.ch/fancalc.php* | |
| // @include http://www.ecalc.ch/helicalc.php* | |
| // @version 1 | |
| // @grant none |
| NSDate *date = [NSDate date]; | |
| NSCalendar *utcCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]; | |
| utcCalendar.timeZone = [NSTimeZone timeZoneWithAbbreviation:@"UTC"]; | |
| unsigned ymdhmsUnitFlags = NSCalendarUnitYear | NSCalendarUnitMonth | NSCalendarUnitDay| NSCalendarUnitHour | NSCalendarUnitMinute | NSCalendarUnitSecond; | |
| NSDateComponents *utcDateComponents = [utcCalendar components:ymdhmsUnitFlags fromDate:date]; | |
| // Create string of form "yyyy-mm-dd hh:mm:ss" |
| # You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
| # This is how I upload my new Sol Trader builds (http://soltrader.net) | |
| # Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
| S3KEY="my aws key" | |
| S3SECRET="my aws secret" # pass these in | |
| function putS3 | |
| { | |
| path=$1 |