This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NODE_EXTERN int Start(int argc, char *argv[]); | |
NODE_EXTERN void Init(int* argc, | |
const char** argv, | |
int* exec_argc, | |
const char*** exec_argv); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2015 the V8 project authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "include/libplatform/libplatform.h" | |
#include "include/v8.h" | |
using namespace v8; | |
class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <omp.h> | |
#include <stdio.h> | |
int main() { | |
#pragma omp parallel | |
printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Correr con: go run codegen.go | |
package main | |
import ( | |
"fmt" | |
"go/ast" | |
"go/parser" | |
"go/printer" | |
"go/token" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mypackage | |
//create_delegate: HelloWorld.Hello(string) string | |
func SayHello(string) (string) { | |
} | |
//create_delegate: HelloWorld.Goodbye(string) string | |
func SayGoodbye(string, int) (string, int) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tyk.decorators import * | |
from gateway import TykGateway as tyk | |
@CustomKeyCheck | |
def MyKeyCheck(request, session, metadata, spec): | |
print("test_auth_middleware: MyKeyCheck") | |
print("test_auth_middleware - Request:", request) | |
print("test_auth_middleware - Session:", session) | |
print("test_auth_middleware - Spec:", spec) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/* | |
Compilar con: | |
GOOS=darwin GOARCH=amd64 go build hello.go | |
*/ | |
import "fmt" | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// #cgo pkg-config: python3 | |
#include <Python.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include "binding.h" | |
#include "../dispatcher.h" | |
static int Python_Init() { | |
Py_Initialize(); | |
return Py_IsInitialized(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
type Car struct { | |
Model string | |
Year int | |
} | |
func( c *Car ) Drive() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cffi import FFI | |
ffi = FFI() | |
ffi.cdef(""" | |
void TykStoreData(char* key, char* value, int ttl); | |
void TykTriggerEvent(char* event_name, char* payload); | |
void CoProcess_Log(char *msg, char *level); | |
""") | |
lib = ffi.dlopen(None) | |
# TODO: Try to load the API header file (avoid code repetition, like in ffi.cdef) |