Skip to content

Instantly share code, notes, and snippets.

Avatar

Fernando Damian Lopez fivunlm

  • Argentina
View GitHub Profile
View load_so.cpp
#include <iostream>
#include <dlfcn.h>
int main() {
using std::cout;
using std::cerr;
cout << "C++ dlopen demo\n\n";
// open the library
cout << "Opening hello.so...\n";
void* handle = dlopen("<<PATH_TO_.SO>>", RTLD_NOW);
View run_tests.sh
#!/bin/bash
export WORKSPACE=`pwd`
# Create/Activate virtualenv
virtualenv venv -p python3.6
source venv/bin/activate
# Install/Update pytest
pip install -U pytest
View router.stubs.ts
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
import {Component, Directive, Injectable, Input, NgModule} from '@angular/core'
import {Subject, Subscriber} from "rxjs";
import {NavigationStart} from "@angular/router";
@Injectable()
export class ActivatedRouteStub {
// ActivatedRoute.params is Observable
View app_engine_test_case.py
class SomeTestCase(unittest.TestCase):
def setUp(self):
self.testbed = testbed.Testbed()
self.testbed.activate()
self.testbed.init_datastore_v3_stub()
self.testbed.init_memcache_stub()
ndb.get_context().clear_cache()
self.app = main.app.test_client()
# Diff is 804 characters long. Set self.maxDiff to None to see it.
View test_template.cs
[TestClass]
public class Test
{
private IApplication MockApp(IScreenService screenService, IMessageRouterService messageRouterService,
IXACService xacService, IDataService dataService)
{
var application = Mock.Interface<IApplication>();
Expect.Once.PropertyGet(() => application.ScreenService).Returns(screenService);
Expect.Once.PropertyGet(() => application.MsgRouterService).Returns(messageRouterService);
Expect.Once.PropertyGet(() => application.XACService).Returns(xacService);
View manager.py
#!/usr/bin/python3
import argparse
import logging
import os
import sys
LOG_DIR = '/var/log/'