Skip to content

Instantly share code, notes, and snippets.

@alexandruc
alexandruc / Dispatcher.h
Created August 28, 2011 19:17
Dispatcher class: asynchronousely dispathces messages
#pragma once
#include <windows.h>
#include <queue>
/**
* Default deallocation function (no deallocation)
*/
typedef void (*noDeleteFunction)(...);
/** \p Dispatcher class: asynchronousely dispathces messages
@alexandruc
alexandruc / check_delivery.sh
Created May 15, 2012 10:49
merge and check folders
#!/bin/bash
#checks and merges 2 folders
output_file="output.txt"
sep_chr="----"
c_dir=$( pwd )
n_args=2 #minimum number of args
mmerge=0
#some colors
text_green=$(tput setaf 2)
@alexandruc
alexandruc / libjingle_examples.gyp
Created November 4, 2015 07:40
Gyp file for building peerconnection_client/server on linux
#
# Copyright 2012 The WebRTC 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 in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project authors may
# be found in the AUTHORS file in the root of the source tree.
{
@alexandruc
alexandruc / save_attachments.vb
Created February 5, 2013 11:51
save all attachments from all emails in a Lotus Notes folder
Sub Click(Source As Button)
Dim dialog As New NotesUIWorkspace
Dim Maildb As NotesDatabase
Dim Session As New NotesSession
Dim view As NotesView
Set Maildb = Session.CurrentDatabase
' ATTENTION: enter the folder name here
folderName = "testfolder"
@alexandruc
alexandruc / producer-consumer.cpp
Created August 31, 2016 11:37
pthread producer-consumer
#include <iostream>
#include <pthread.h>
bool bEnd = false;
pthread_cond_t cv;
pthread_mutex_t mp;
bool bDataReady = false;
bool bProcessed = false;
void* perform_work(void* argument) {
@alexandruc
alexandruc / gstreamer-android-mips.patch
Last active August 31, 2016 11:52
Gstreamer patch for android mips build - for cerbero rev 4df49a735b00134516bafa44301bf424108166f5
diff --git a/cerbero/enums.py b/cerbero/enums.py
index 88edefe..f80373e 100644
--- a/cerbero/enums.py
+++ b/cerbero/enums.py
@@ -34,7 +34,7 @@ class Architecture:
UNIVERSAL = 'universal'
ARM = 'arm'
ARMv7 = 'armv7'
-
+ MIPS = 'mips'
@alexandruc
alexandruc / sns_push_notification.cpp
Created October 31, 2017 09:30
SNS send push notification
#include <iostream>
#include <aws/core/Aws.h>
#include <aws/sns/SNSClient.h>
#include <aws/core/auth/AWSCredentialsProvider.h>
#include <aws/sns/model/PublishRequest.h>
#include <aws/sns/model/MessageAttributeValue.h>
int main(int argc, char *argv[])
{
Aws::SDKOptions options;
@alexandruc
alexandruc / readable_sql.cpp
Created October 31, 2017 09:50
Readable sql string
#include <iostream>
#include <string>
#define SQL(...) #__VA_ARGS__
int main(int argc, char *argv[])
{
std::string strDynSql = "dynparam";
std::string strSql( SQL(
@alexandruc
alexandruc / roman_numerals.lua
Created April 5, 2012 15:03
Roman numerals in Lua
--[[
Rules:
I = 1
V = 5
X = 10
L = 50
C = 100
D = 500
M = 1000
# Small script to transform hugo markdown files with html to pure markdown
import requests
import os
import dateparser
url = "https://tools.atatus.com/tools/html-to-markdown"
working_dir = "location of the hugo blog posts"
posts = os.listdir(working_dir)