Skip to content

Instantly share code, notes, and snippets.

# 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)
@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 / 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 / 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 / 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 / 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 / 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 / sd_card_detect_libudev.cpp
Created June 8, 2012 13:08
Detect SD card and get SD card notifications using libudev
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stddef.h>
#include <errno.h>
#include <sys/time.h> //debug -> remove me
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
@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 / socket_client.cpp
Created April 10, 2012 12:13
Unix domain sockets example
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/types.h>
static const char* socket_path = "/home/mysocket";
static const unsigned int s_recv_len = 200;
static const unsigned int s_send_len = 100;