Skip to content

Instantly share code, notes, and snippets.

View izinin's full-sized avatar

Igor Zinin izinin

View GitHub Profile
@psamsotha
psamsotha / TestFrameworkStarter.java
Last active April 29, 2020 15:35
Starter for Jersey Test Framework
import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
@rimusz
rimusz / preemtible_kubernetes.md
Last active July 7, 2018 02:52 — forked from tsuri/preemtible_kubernetes.md
kubernetes cluster w/ pre-emptible instances

Kubernetes clusters using preemtible instances

Motivation

People experimenting with kubernetes clusters on the GKE not necessarily have money to keep a full cluster on at all time. GKE clusters can be easily resized, but this still incurs in the full instance cost when the cluster is up.

Google has added preemptible instances that are ideal for many

@tablekat
tablekat / main.ts
Created June 30, 2016 20:24
Making gmail push notifications to webhook
import * as request from 'request';
import * as fs from 'fs';
import * as readline from 'readline';
var google = require('googleapis');
var googleAuth = require('google-auth-library');
/*************** STEPS
- made a project on https://console.cloud.google.com/cloudpubsub/topicList?project=testmabs thing?
@tnhu
tnhu / visor-archivos-online.md
Last active December 10, 2018 12:15 — forked from izazueta/visor-archivos-online.md
Google Docs Viewer & Office Web Apps Viewer
@alexpchin
alexpchin / socket-cheatsheet.js
Created December 15, 2015 16:58
A quick cheatsheet for socket.io
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@FND
FND / .gitignore
Last active November 28, 2018 09:53
Riot.js with ES6 via webpack
/node_modules
/dist
@okamayana
okamayana / ndk_basics.md
Last active August 1, 2024 05:46
Android Studio: Writing and calling JNI functions

Purpose

Writing JNI functions

  1. Create a new Android Studio project. To do so, select File -> New -> New Project.
@p120ph37
p120ph37 / chunkedpost.c
Created August 30, 2015 18:46
Curl example with chunked post
/*
* HTTP POST with chunked encoding.
*
* Usage:
* cc chunkedpost.c -lcurl -o chunkedpost
* ./chunkedpost
*
*/
#include <stdio.h>
#include <stdlib.h>
@mrserverless
mrserverless / CORSContainerResponseFilter.java
Last active October 5, 2022 20:47
Jersey ContainerResponseFilter example of CORS Filter. The Jetty version is more comprehensive: https://gist.github.com/yunspace/07d80a9ac32901f1e149
import javax.inject.Singleton;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.ext.Provider;
import java.io.IOException;
@Singleton
@Provider
@jaredmorrow
jaredmorrow / read_write_fifo_erlang.md
Last active April 22, 2023 20:05
Reading and Writing to Fifo (named pipes) in Erlang

edit

@akash-akya pointed out in the comments that the file module supports named pipes since OTP 20. So none of this post is really needed anymore if you are on >= OTP 21.


Erlang and Named Pipes

The intention of this post is to provide a solution (with examples) to a somewhat uncommon issue in Erlang. I hate searching for answers to the same problems over and over, and I had a hard time finding answers to this particular problem, so I wrote it all down once I figured it out. If one day you decide to read and write data through fifo's (named pipes) and then decide you want to read or write the other end of the pipe from Erlang, this post is for you.