Skip to content

Instantly share code, notes, and snippets.

Avatar

Radek Pazdera pazdera

View GitHub Profile
@pazdera
pazdera / github-release.sh
Created Oct 17, 2018
Create a github release for an existing tag from the command line
View github-release.sh
#!/usr/bin/env bash
# https://developer.github.com/v3/repos/releases/#create-a-release
repo=$1
tag=$2
name=$3
text=$4
token=$GH_TOKEN
@pazdera
pazdera / yardoc-cheatsheet.rb
Last active Nov 5, 2016
Basic Yard Syntax (contributions welcome)
View yardoc-cheatsheet.rb
# Quick summary of the function
#
# {ObjectName#method Optional Title}
# {Class::CONSTANT Optional Title}
# {#method_inside_current_namespace}
#
# @see #method
#
# @param one [Fixnum] First parameter
# @param two [Fixnum] Second parameter
@pazdera
pazdera / dirstat.c
Created Oct 14, 2012
getdents + stat
View dirstat.c
/* getdents() + stat() scenario
*
* This program is based on an example from linux man page getdents(2)
*/
#define _GNU_SOURCE
#include <dirent.h> /* Defines DT_* constants */
#include <fcntl.h>
#include <stdio.h>
@pazdera
pazdera / limits.c
Created Feb 15, 2012
Size of some integer types
View limits.c
/* Integer types -- sizes */
#include <stdio.h>
#include <stdint.h>
int main(void)
{
printf("int bytes: %d\n", sizeof(int));
printf("uint32_t bytes: %d\n", sizeof(uint32_t));
@pazdera
pazdera / bridge.py
Created Aug 26, 2011
Example of `bridge' design pattern in Python
View bridge.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example of `bridge' design pattern
# This code is part of http://wp.me/p1Fz60-8y
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
@pazdera
pazdera / bridge.cpp
Created Aug 15, 2011
Example of `bridge' design pattern in C++
View bridge.cpp
/*
* Example of `bridge' design pattern
* Copyright (C) 2011 Radek Pazdera
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
@pazdera
pazdera / gist:1146033
Created Aug 15, 2011
References for Wordpress.com
View gist:1146033
<!-- Reference -->
<sup>[<a href="#sources">1</a>]</sup>
<!-- Sources -->
<h2 id="sources">Sources</h2>
<ol>
<li>ref</li>
</ol>
@pazdera
pazdera / adapter.py
Created Aug 15, 2011
Example of `adapter' design pattern in Python
View adapter.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example of `adapter' design pattern
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@pazdera
pazdera / adapter.cpp
Created Aug 15, 2011
Example of `adapter' design pattern in C++
View adapter.cpp
/*
* Example of `adapter' design pattern
* Copyright (C) 2011 Radek Pazdera
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
@pazdera
pazdera / object_pool.py
Created Aug 4, 2011
Example of `object pool' design pattern in Python
View object_pool.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Example of `object pool' design pattern
# Copyright (C) 2011 Radek Pazdera
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.