Skip to content

Instantly share code, notes, and snippets.

@htp
htp / curl-websocket.sh
Last active May 14, 2024 21:24
Test a WebSocket using curl.
curl --include \
--no-buffer \
--header "Connection: Upgrade" \
--header "Upgrade: websocket" \
--header "Host: example.com:80" \
--header "Origin: http://example.com:80" \
--header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
--header "Sec-WebSocket-Version: 13" \
http://example.com:80/
@d4goxn
d4goxn / s-function.json
Created May 9, 2016 15:58
Serverless CloudFormation config for Elasticache Redis server
{
"name": "showConfig",
"runtime": "nodejs",
"description": "Returns Redis host and Serverless stage",
"handler": "redis/showConfig/handler.handler",
"timeout": 6,
"memorySize": 256,
"custom": {
"optimize": true
},
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
#!/bin/bash -xv
### Country list
# CHANGE WITH YOUR COUNTRIES
COUNTRIES="europe/france/guadeloupe europe/france/guyane europe/france/mayotte europe/france/martinique europe/france/reunion europe/france"
# SMALL SUBSET FOR TESTING:
COUNTRIES="europe/france/guyane europe/france/mayotte"
NOMINATIM="/var/www/Nominatim"
cd $NOMINATIM/data
@tvdstaaij
tvdstaaij / protobufjs-stringify-enums.js
Last active June 30, 2016 14:51
Convert ProtoBuf.js enum values to strings using reflection
var _ = require('lodash');
function stringifyEnums(message) {
_.forEach(message.$type.children, function(child) {
var type = _.get(child, 'element.resolvedType', null);
if (type && type.className === 'Enum' && type.children) {
var metaValue = _.find(type.children, {
id: message[child.name]
});
if (metaValue && metaValue.name)
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active June 1, 2024 09:44
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@kwilczynski
kwilczynski / kafka.service
Last active February 17, 2021 05:10
kafka.service for systemd
[Unit]
Description=Apache Kafka server (broker)
Documentation=http://kafka.apache.org/documentation.html
Requires=network.target remote-fs.target syslog.target
After=network.target remote-fs.target syslog.target
ConditionPathExists=/etc/kafka/server.properties
ConditionPathExists=/var/lib/kafka
[Service]
Type=simple
@brucecoddington
brucecoddington / resources.js
Last active June 27, 2020 14:42
Wrapping $resource with api and data services.
angular.module('app.resources', ['ngResource'])
.factory('api', function ($resource) {
var api = {
defaultConfig : {id: '@id'},
extraMethods: {
'update' : {
method: 'PUT'
}
@rtt
rtt / tinder-api-documentation.md
Last active May 5, 2024 15:28
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)