Skip to content

Instantly share code, notes, and snippets.

View user20161119's full-sized avatar
👍
突破边界,直到很痛

noboday user20161119

👍
突破边界,直到很痛
View GitHub Profile
@user20161119
user20161119 / countries_codes_and_coordinates.csv
Created May 27, 2021 08:39 — forked from tadast/countries_codes_and_coordinates.csv
Countries with their (ISO 3166-1) Alpha-2 code, Alpha-3 code, UN M49, average latitude and longitude coordinates
Country Alpha-2 code Alpha-3 code Numeric code Latitude (average) Longitude (average)
Afghanistan AF AFG 4 33 65
Albania AL ALB 8 41 20
Algeria DZ DZA 12 28 3
American Samoa AS ASM 16 -14.3333 -170
Andorra AD AND 20 42.5 1.6
Angola AO AGO 24 -12.5 18.5
Anguilla AI AIA 660 18.25 -63.1667
Antarctica AQ ATA 10 -90 0
Antigua and Barbuda AG ATG 28 17.05 -61.8
@user20161119
user20161119 / ParseRequestBodyToBytes.java
Created November 12, 2015 07:18 — forked from yanhua365/ParseRequestBodyToBytes.java
从HTTP Request里取得body内容得到byte数组的方法。
public byte[] parse(HttpServletRequest request) {
byte[] input = null;
try {
InputStream is = request.getInputStream();
ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
while (true) {
int c = is.read();
if (c == -1) break;
byteStream.write((byte) c);
@user20161119
user20161119 / LoggerFilter
Created November 12, 2015 07:17 — forked from calo81/LoggerFilter
Filter for reading and logging HttpServletRequest body, and resetting the input stream
package com.paddypower.financials.market.management.rest.logging;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
@user20161119
user20161119 / ssl.rules
Last active November 23, 2017 02:26 — forked from konklone/ssl.rules
# Basically the nginx configuration I use at konklone.com.
# I check it using https://www.ssllabs.com/ssltest/analyze.html?d=konklone.com
#
# To provide feedback, please tweet at @konklone or email eric@konklone.com.
# Comments on gists don't notify the author.
#
# Thanks to WubTheCaptain (https://wubthecaptain.eu) for his help and ciphersuites.
# Thanks to Ilya Grigorik (https://www.igvita.com) for constant inspiration.
server {

Gitlab Gmail configuration

In Gitlab 2.6 you must edit the following files in order to send messages through a Gmail account (also applicable to Google Apps accounts).

config/environments/production.rb

config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.raise_delivery_errors = true
var myDataSource = new YAHOO.util.DataSource( "[YOUR_DATA_URL]" );
myDataSource.connMethodPost = true;
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
myDataSource.responseSchema =
{
resultsList: "sales",
fields: ["order_date","northamerican", "asian"]
};
myDataSource.doBeforeParseData = function (oRequest, oFullResponse, oCallback)
myDataSource.doBeforeParseData = function (oRequest, oFullResponse, oCallback)
{
var i, results = oFullResponse.sales,
len = results.length,
filter,
hash = {},
item,
parsedItem,
parsedItems = [];
for(i = 0; i < len; ++i)