Skip to content

Instantly share code, notes, and snippets.

Avatar
🤙
Looking for a project to help with/contribute!

Patryk Małek pmalek

🤙
Looking for a project to help with/contribute!
View GitHub Profile
@pmalek
pmalek / commit-msg.py
Created Nov 14, 2015
commit-msg hook checking whether there already exists a commit in git repository with passed in commit message
View commit-msg.py
#!/usr/bin/python
from subprocess import check_output
import sys
class Colors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
@pmalek
pmalek / main.c
Created Jun 12, 2015
Search for palindroms from one file and put it alphabetically in another
View main.c
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
int is_pal(char* word) {
size_t len = strlen(word);
char* begin = word;
char* end = word + len - 2; // -2 beacuse we get the newline char as well
if (len == 1) {
@pmalek
pmalek / results_pypy2.5.1
Created Jun 1, 2015
python vs pypy comparison benchmarks using Python 2.7.6 and PyPy 2.5.1
View results_pypy2.5.1
Python 2.7.9 (2.5.1+dfsg-1~ppa1+ubuntu14.04, Mar 27 2015, 19:19:42)
[PyPy 2.5.1 with GCC 4.8.2]
Using arena file:
example_benchmarks/zeros.py
- zeros_imul
- zeros_mul
- zeros_repeat
- zeros_slow
Using benchmark file:
@pmalek
pmalek / install_gcc.sh
Last active Jan 15, 2019
gcc installation script for Centos6.6 (probably can be used for other distributions). It also installs dependencies like mpc, mpfr and gmp !NOTE: As of now this only works for installations with PREFIX=/usr/local
View install_gcc.sh
#!/bin/bash
LOGFILE=/tmp/gcc_install.log
# $1 - package name
errorIf(){
if [ $? -ne 0 ]; then
echo "Something was wrong with $1"
exit 1
fi
@pmalek
pmalek / README
Last active Aug 29, 2015
ralink mt7601 linux driver patch. Take a look into README
View README
This patch may not necessarily work - this is a better version at launchpad by Victor Martinez https://code.launchpad.net/~victored/+junk/mt7601U-linux-driver-64bit
after:
sudo make install,
do
sudo modprobe mt7601Usta
@pmalek
pmalek / add_to_eclipse.ini
Created Sep 10, 2014
Fix eclipse (adt) crashing with libsoup segfault. Add this to eclipse.ini
View add_to_eclipse.ini
-Dorg.eclipse.swt.browser.DefaultType=mozilla
View concatenate.sh
gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=output.pdf file1.pdf file2.pdf file3.pdf [...] lastfile.pdf
@pmalek
pmalek / android_hide_title_bar.java
Created Apr 23, 2014
Hide title bar in Android
View android_hide_title_bar.java
requestWindowFeature(Window.FEATURE_NO_TITLE);
@pmalek
pmalek / android_hide_status_bar.java
Created Apr 23, 2014
Hide status bar in Android
View android_hide_status_bar.java
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
@pmalek
pmalek / fglrx_fix
Created Mar 21, 2014
Fglrx new kernels fix
View fglrx_fix
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,6,3)
if (!ACPI_SUCCESS(acpi_get_table_with_size(id, 0, &hdr, &tbl_size)))
#else
tbl_size = 0x7fffffff;
if (!ACPI_SUCCESS(acpi_get_table(id, 0, &hdr)))
#endif
{
return KCL_ACPI_ERROR;
}
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,9,1)