Skip to content

Instantly share code, notes, and snippets.

View rsrini7's full-sized avatar
😃
Happy

Srinivasan Ragothaman rsrini7

😃
Happy
View GitHub Profile
@egaumer
egaumer / DSL Examples
Last active June 26, 2019 20:21
Some example queries using elastic.js
# simple match all query with term facet
ejs.Request()
.indices("myindex")
.types("mytype")
.query(ejs.MatchAllQuery())
.facet(
ejs.TermsFacet('url')
.field('url')
.size(20))
@stevecj
stevecj / gist:9ace6a70370f6d1a1511
Last active December 2, 2019 06:34
Ruby will destructure objects that are not arrays, but respond to #to_ary
S=Struct.new(:a,:b)
ss = [S.new(1,2), S.new(3,4)]
p ss.map{|a,b| "#{a} #{b}" }
# => ["#<struct S a=1, b=2> ", "#<struct S a=3, b=4> "]
class S ; def to_ary ; to_a ; end ; end
p ss.map{|a,b| "#{a} #{b}" }
# => ["1 2", "3 4"]
@jonashackt
jonashackt / RestTemplateConfig.java
Created November 26, 2015 14:34
Spring RestTemplate with Support for Connecting to https with selfsigned Certificates (ApacheHTTPClient >= 4.4) and ByteArrays in Responses
import java.util.ArrayList;
import java.util.List;
import org.apache.http.conn.ssl.NoopHostnameVerifier;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.springframework.http.MediaType;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.http.converter.ByteArrayHttpMessageConverter;
import org.springframework.web.client.RestTemplate;
@goeroeku
goeroeku / .bashrc.md
Last active October 18, 2020 12:12
All About Arch / Manjaro

setting bashrc or bash_profile

location : ~./.bashrc | ~/.bash_profile
#
# ~/.bashrc
#

[[ $- != *i* ]] && return
diff --git a/ext/bluecloth.h b/ext/bluecloth.h
index 230618b..97053b5 100644
--- a/ext/bluecloth.h
+++ b/ext/bluecloth.h
@@ -7,20 +7,21 @@
#ifndef BLUECLOTH_H
#define BLUECLOTH_H
+#include "ruby.h"
+
@vhoulbreque
vhoulbreque / nteract-tricks.md
Last active March 30, 2021 14:44
Make conda environments visible in nteract

Nteract tricks

To add a conda environment to the list of environments:

$ source activate thisenv
(thisenv) $ pip install ipykernel
(thisenv) $ python -m ipykernel install --user --name thisenv
@mogsdad
mogsdad / GCalUtils.md
Last active May 10, 2021 17:39
Collection of Google Calendar related utility functions for Google Apps Script.

Google Calendar Utilities

getEventsWithGuest

Gets all events that occur within a given time range, and that include the specified guest email in the guest list.

###Parameters:###

/*******************************************************************************
* Copyright (c) 2013,2014 Rüdiger Herrmann
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Rüdiger Herrmann - initial API and implementation
* Matt Morrissette - allow to use non-static inner IgnoreConditions
@aquiseb
aquiseb / Go_Context.go
Last active September 12, 2022 19:54
Golang context package examples
package main
import (
"bufio"
"context"
"fmt"
"log"
"os"
"time"
)