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 | |
| /usr/bin/ssh -i /path/to/identity.file "$@" | |
| # Usage: GIT_SSH=~/bin/gitssh git fetch |
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
| // Add cookie support to HttpClient | |
| var clientHandler = new HttpClientHandler(); | |
| clientHandler.CookieContainer = new CookieContainer(); | |
| var httpClient = new HttpClient(clientHandler); | |
| // set cookie into reponse | |
| var response = new HttpResponseMessage(HttpStatusCode.OK); | |
| var cookie = new CookieHeaderValue("cookie_name", "cookie_value") {Path = "/"}; |
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
| report = %Q( | |
| green assignees_v15 5 1 305663 66279 901.1mb 450.5mb | |
| green engagements_v10 5 1 2759 1 1.4mb 727.6kb | |
| green workrecords_v10 5 1 2192650 497011 1.8gb 963.4mb | |
| green workrecords_v11 5 1 2192536 608674 2.2gb 1.1gb | |
| green assignees_v10 5 1 288318 87823 527.7mb 263.8mb | |
| green workrecords_v12 5 1 2438073 1448777 3.6gb 1.8gb | |
| green engagements_v9 5 1 3786 122 2mb 992.1kb | |
| green assignees_v16 5 1 322824 106125 1005.7mb 529.5mb | |
| green assignees_v9 5 1 286386 59311 434.9mb 217.4mb |
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
| { | |
| "query": { | |
| "filtered": { | |
| "query": { | |
| "multi_match": { | |
| "query": "a", | |
| "type": "cross_fields", | |
| "operator": "AND", | |
| "fields": [ | |
| "employeeId", |
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
| // http://stackoverflow.com/questions/954982/uinavigationcontroller-poptorootviewcontroller-and-then-immediately-push-a-new | |
| MyViewController* controller = [self.storyboard instantiateViewControllerWithIdentifier:@"MyViewController"]; | |
| UINavigationController * navigationController = self.navigationController; | |
| [navigationController popToRootViewControllerAnimated:NO]; | |
| [navigationController pushViewController:controller animated:YES]; |
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
| #! /usr/bin/env bash | |
| url="https://raw.githubusercontent.com/github/gitignore/master/$1" | |
| echo "Save $url to .gitignore" | |
| curl "https://raw.githubusercontent.com/github/gitignore/master/$1.gitignore" > .gitignore |
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
| require "fileutils" | |
| class Project | |
| attr_accessor :username, :repository_name | |
| def initialize(username, repository_name) | |
| @username, @repository_name = username, repository_name | |
| end | |
| def repository_url |
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
| 08/11/12 18:30:06 [========== C_SPOC COMMAND LINE ==========] | |
| 08/11/12 18:30:06 /usr/es/sbin/cluster/sbin/cl_getpv -cspoc -f -n GU5200QP,GU5200QB | |
| 08/11/12 18:30:07 GU5200QB: success: cllsvgdata | |
| 08/11/12 18:30:07 GU5200QP: success: cllsvgdata | |
| 08/11/12 18:48:29 [========== C_SPOC COMMAND LINE ==========] | |
| 08/11/12 18:48:29 /usr/es/sbin/cluster/sbin/cl_getpv -cspoc -f -n GU5200QP,GU5200QB | |
| 08/11/12 18:48:30 GU5200QB: success: cllsvgdata | |
| 08/11/12 18:48:30 GU5200QP: success: cllsvgdata |
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
| import org.elasticsearch.action.admin.indices.create.CreateIndexResponse; | |
| import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequestBuilder; | |
| import org.elasticsearch.action.admin.indices.delete.DeleteIndexResponse; | |
| import org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse; | |
| import org.elasticsearch.action.bulk.BulkRequestBuilder; | |
| import org.elasticsearch.action.search.SearchResponse; | |
| import org.elasticsearch.action.search.SearchType; | |
| import org.elasticsearch.client.Client; | |
| import org.elasticsearch.client.transport.TransportClient; | |
| import org.elasticsearch.common.joda.time.DateTime; |
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
| NSData *imageData = UIImagePNGRepresentation(image); | |
| NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"http://example.com/images/upload"]]; | |
| [request setHTTPMethod:@"POST"]; | |
| [request addValue:@"image/jpeg" forHTTPHeaderField:@"Content-Type"]; | |
| [request setHTTPBody:imageData]; | |
| AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; | |
| manager.requestSerializer = [AFJSONRequestSerializer serializer]; | |
| [manager.requestSerializer setValue: @"application/json; charset=utf-8" forHTTPHeaderField: @"Content-Type"]; |