Skip to content

Instantly share code, notes, and snippets.

💻
Work work

Wojtek Siudzinski suda

💻
Work work
Block or report user

Report or block suda

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@andyvanee
andyvanee / .ssh_config
Last active Oct 17, 2019
Fix unix_listener too long for Unix domain socket
View .ssh_config
Host *
ControlPath ~/.ssh/control/%C
ControlMaster auto
@aras-p
aras-p / preprocessor_fun.h
Last active Oct 16, 2019
Things to commit just before leaving your job
View preprocessor_fun.h
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@armornick
armornick / playwav.c
Created Aug 24, 2012
Play a sound with SDL2 (no SDL_Mixer)
View playwav.c
#include <SDL2/SDL.h>
#define MUS_PATH "Roland-GR-1-Trumpet-C5.wav"
// prototype for our audio callback
// see the implementation for more information
void my_audio_callback(void *userdata, Uint8 *stream, int len);
// variable declarations
static Uint8 *audio_pos; // global pointer to the audio buffer to be played
@juanriaza
juanriaza / bicimad.py
Created Jun 11, 2019
bicimad stations
View bicimad.py
import json
import gzip
import requests
import binascii
response = requests.post(
'https://api.bicimad.com/emt_v10/',
json={
"app_hash":"c26a08fe1d186dad371881fd6a3fab29438a8c48_com.emtmadrid.bicimad.gestion2",
@arriolac
arriolac / TopCropImageView.java
Last active Sep 17, 2019
Custom Android ImageView for top-crop scaling of the contained drawable.
View TopCropImageView.java
import android.annotation.TargetApi;
import android.content.Context;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.util.AttributeSet;
import android.widget.ImageView;
/**
* Created by chris on 7/27/16.
@davisford
davisford / setup-avahi.sh
Created Jul 12, 2013
Setup avahi-daemon on Ubuntu for so you can reach hostname `ubuntu.local` from host OS
View setup-avahi.sh
sudo apt-get install avahi-daemon avahi-discover avahi-utils libnss-mdns mdns-scan
@jgoodall
jgoodall / README.md
Last active Aug 25, 2019
This is a sample of how to send some information to logstash via the TCP input from node.js or python.
View README.md

This is a sample of how to send some information to logstash via the TCP input in nodejs or python. It assumes the logstash host is on 10.10.10.100 and the TCP listening input is 9563.

The logstash.conf should look something like the sample file.

The log message should be a stringified JSON object with the log message in the @message field.

To use, run the node script node sendMessageToLogstash.js, or the python script python sendMessageToLogstash.js

@phanan
phanan / runner.js
Last active Jul 18, 2019
Record a webpage with PhantomJS and FFMpeg
View runner.js
// Run this from the commandline:
// phantomjs runner.js | ffmpeg -y -c:v png -f image2pipe -r 24 -t 10 -i - -c:v libx264 -pix_fmt yuv420p -movflags +faststart output.mp4
var page = require('webpage').create(),
address = 'http://s.codepen.io/phanan/fullembedgrid/YPLewm?type=embed&safe=true&_t=1424767252279',
duration = 3, // duration of the video, in seconds
framerate = 24, // number of frames per second. 24 is a good value.
counter = 0,
width = 500,
height = 500;
@frdmn
frdmn / osx-10-10-virtualbox.md
Last active Jun 20, 2019
Install OS X 10.10 Yosemite in VirtualBox
View osx-10-10-virtualbox.md
@Jaybles
Jaybles / UIDeviceHardware.h
Created Oct 28, 2011
UIDeviceHardware - Determine iOS device being used
View UIDeviceHardware.h
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;
You can’t perform that action at this time.