Skip to content

Instantly share code, notes, and snippets.

View soplwang's full-sized avatar

Wang Wenlin soplwang

View GitHub Profile
@queerviolet
queerviolet / block-transactions.ts
Last active May 25, 2024 04:38
Handling Database Transactions with Apollo Server
/**
* If your database provides block transactions, (like Sequelize,
* here: https://sequelize.org/master/manual/transactions.html) here's how to
* use them in Apollo Server:
*/
import { ApolloServerPlugin, GraphQLRequestContext } from 'apollo-server-plugin-base'
export interface Transactable<Txn> {
transact?: Transact<Txn>
@marc-hanheide
marc-hanheide / ssh.vpn.sh
Created May 27, 2015 20:27
ssh-vpn via ppp (OSX)
#
# You will need to change these variables...
#
# The host name or IP address of the SSH server that we are
# sending the connection request to:
SERVER_HOSTNAME=harek

WebRTC negotiation over IRC

Copyright (c) 2015 Patrick Cloke clokep@instantbird.org

Unlimited redistribution and modification of this document is allowed provided that the above copyright notice and this permission notice remains intact.

WebRTC

@Kentzo
Kentzo / CFSocket.c
Created October 21, 2012 12:35
NEW_SOCKET from
#include <CoreFoundation/CFSocket.h>
#include "CFInternal.h"
#include <dispatch/dispatch.h>
#include <dispatch/private.h>
#include <netinet/in.h>
#include <sys/sysctl.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <unistd.h>