Skip to content

Instantly share code, notes, and snippets.

View soulmachine's full-sized avatar

Frank Dai soulmachine

View GitHub Profile
@souhaiebtar
souhaiebtar / charles key
Created January 13, 2020 14:33
[charles proxy key] an activation key #key #activation
// Charles Proxy License
// Registration code for any version of Charles, who would want to use a cracked version?
// Charles 4.5.5 is currently the latest version and is available.
Registered Name: https://zhile.io
License Key: 48891cf209c6d32bf4
Author: Neo Peng
@mikebridge
mikebridge / ExampleComponent.tsx
Created March 22, 2017 15:43
Typescript component using react-intl
import * as React from "react";
import SelectField from "material-ui/SelectField";
import { intlShape, injectIntl, FormattedMessage, InjectedIntlProps } from "react-intl";
interface IExampleProps {
// ...
}
class ExampleComponentWrapped extends React.Component<IExampleProps & InjectedIntlProps, {}> {
@amgorb
amgorb / redis-client-ouput-buffer-limit
Created February 20, 2017 16:19
redis replication scheduled to be closed ASAP for overcoming of output buffer limits.
If you redis initial replication fails with error like
"5101:M 20 Feb 18:14:29.130 # Client id=4500196 addr=71.459.815.760:43872 fd=533 name= age=127 idle=127 flags=S db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=0 obl=13997 oll=1227 omem=192281275 events=rw cmd=psync scheduled to be closed ASAP for overcoming of output buffer limits.
means that slave buffer is not enough and you should increase it (at master!) with command like
redis-cli config set client-output-buffer-limit "slave 836870912 836870912 0"
more info: https://redis.io/topics/clients
@deepika087
deepika087 / GenericMultiListIterator.java
Last active June 11, 2018 15:29
Iterates through (generic) List of List <<a1,a2>, <b1,b2,b3,b4>, <c1,c2,c3,c4,c5,c6,c7>> Generates output a1, b1, c1, a2, b2, c2, b3, c3, b4, c4,c5,c6,c7
package com.expedia.sample;
import java.util.ArrayList;
import java.util.Iterator;
public class MultiListIterator<E> implements Iterator<E> {
private ArrayList<ArrayList<E>> useThisList;
private int numOfList;
private int[] sizeOfEachList;
@mbijon
mbijon / disable-xss-auditor.sh
Created September 19, 2016 19:04
CLI command to start Chrome with XSS Auditor disabled. Use for XSS/security testing
'/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' --disable-xss-auditor --enable-devtools-experiments --disable-features=enable-automatic-password-saving
@devilelephant
devilelephant / AWS4Signer.groovy
Last active October 21, 2019 08:24
Java/Groovy example of using Amazon AWS AWS4Signer class to sign requests (in our case elasticsearch calls)
package com.clario.aws
import com.amazonaws.DefaultRequest
import com.amazonaws.SignableRequest
import com.amazonaws.auth.AWS4Signer
import com.amazonaws.auth.AWSCredentialsProvider
import com.amazonaws.http.HttpMethodName
import groovy.util.logging.Slf4j
import org.apache.http.client.utils.URLEncodedUtils
import org.springframework.http.HttpHeaders
@veselosky
veselosky / s3gzip.py
Last active August 29, 2024 11:32
How to store and retrieve gzip-compressed objects in AWS S3
# vim: set fileencoding=utf-8 :
#
# How to store and retrieve gzip-compressed objects in AWS S3
###########################################################################
#
# Copyright 2015 Vince Veselosky and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@gaearon
gaearon / slim-redux.js
Last active December 3, 2024 06:34
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@efenderbosch
efenderbosch / PipelinedRedisTokenStore
Last active February 5, 2016 12:48
Pipelined Redis Token Store
package com.example
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import org.springframework.data.redis.connection.RedisConnection;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.serializer.JdkSerializationRedisSerializer;
@hmartiro
hmartiro / zeromq-vs-redis.md
Last active December 16, 2024 04:02
Comparison of ZeroMQ and Redis for a robot control platform

ZeroMQ vs Redis

This document is research for the selection of a communication platform for robot-net.

Goal

The purpose of this component is to enable rapid, reliable, and elegant communication between the various nodes of the network, including controllers, sensors, and actuators (robot drivers). It will act as the core of robot-net to create a standardized infrastructure for robot control.

Requirements: