Skip to content

Instantly share code, notes, and snippets.

View kuba-orlik's full-sized avatar

Kuba Orlik kuba-orlik

  • Poznań, Poland
View GitHub Profile
Notice: Undefined variable: mod_strings in /var/www/modules/CustomView/CustomView.php on line 17
Notice: Undefined variable: mod_strings in /var/www/modules/CustomView/CustomView.php on line 18
Notice: Undefined variable: mod_strings in /var/www/modules/CustomView/CustomView.php on line 19
Notice: Undefined variable: mod_strings in /var/www/modules/CustomView/CustomView.php on line 20
Notice: Undefined variable: mod_strings in /var/www/modules/CustomView/CustomView.php on line 21
main: startup
RESULT:1
RESULT:2
RESULT:191
RESULT:285
RESULT:403
RESULT:520
Segmentation fault (core dumped)
#include <iostream>
#include <boost/thread.hpp>
#include <boost/functional.hpp>
#include <boost/lockfree/spsc_queue.hpp>
using namespace std;
void workerFunc(const char* msg, boost::lockfree::spsc_queue<int, boost::lockfree::capacity<1024>> *queue)
{
for(int i=1; i<=1000; i++){
#include <stdio.h>
#include <iostream>
#include "./../type_config.cpp"
using namespace std;
int main(){
freopen(NULL, "rb", stdin);
char buf[sizeof(type_name)*8];
fread(buf, sizeof(buf), 1, stdin);
@kuba-orlik
kuba-orlik / raisewindow.sh
Created April 9, 2017 18:30
Windows+number shortcuts for Linux
#!/bin/bash
# Usage:
# Put it somewhere where PATH points to and make it executable. Then:
# raisewindow.sh <executable name>
# Example:
# bind `<Windows (Super, Meta)> + 1` to `raisewindow.sh firefox`
# it will raise the firefox window if it's already open and launch firefox if it isn't
@kuba-orlik
kuba-orlik / README.md
Last active July 29, 2022 10:27
Remove old events from a big ics calendar file

Removes all events preceeding a given year from an .ics calendar file (the kind you can find e.g. in a Radicale-based CalDAV server).

Usage:

./trim-calendar.sh Personal 2016 # removes all events starting before the year 2016 from the calendar stored in Personal.ics file
diff --git a/lib/chip-types/field-type.js b/lib/chip-types/field-type.js
index 74fbbac..e70681e 100644
--- a/lib/chip-types/field-type.js
+++ b/lib/chip-types/field-type.js
@@ -71,6 +71,8 @@ FieldType.prototype = new function(){
} else {
ret = this["_" + method_name].bind(this);
}
+ console.log(this.name);
+ console.log(ret);
@kuba-orlik
kuba-orlik / Return char*
Created August 20, 2014 11:32
Returning dynamically generated array of char in c++
std::string returning_string(){
//
..code here
std::string result=...
//
int length = result.length();
char* char_array = new char[length];
strcpy_s(char_array, length+1, wrapped_bstr);
return char_array;
}
@kuba-orlik
kuba-orlik / BSTR to std-string.cpp
Last active June 27, 2021 21:56
Convert BSTR to std::string
#include "stdafx.h"
#include <wtypes.h>
#include <comutil.h>
#pragma comment(lib,"comsuppw.lib")
#include <string>
#include <string.h>
#include <stdio.h>
using namespace std;