Skip to content

Instantly share code, notes, and snippets.

View AdamMagaluk's full-sized avatar
🚀

Adam Magaluk AdamMagaluk

🚀
View GitHub Profile
@AdamMagaluk
AdamMagaluk / gist:3908311
Created October 17, 2012 21:25
libwebsockets - libwebsockets_fork_service_loop
int fd;
struct sockaddr_in cli_addr;
int n;
int p;
n = fork();
if (n < 0)
return n;
if (!n) {
@AdamMagaluk
AdamMagaluk / .bash_profile
Last active December 11, 2015 06:09 — forked from kevinohara80/.bash_profile
Forked from Kevin O'Hara, but added mercurial fall back when git repo does not exist.
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_hg_branch() {
echo -ne "[`hg branch 2> /dev/null`"; if [ "`hg status 2> /dev/null`" ]; then echo "*]"; else echo "]"; fi
}
function parse_git_branch() {
B=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"`
@AdamMagaluk
AdamMagaluk / profile-hg_git.markdown
Last active December 11, 2015 06:19
Profile data between git/mercurial commands
@AdamMagaluk
AdamMagaluk / imap.js
Created February 25, 2013 16:00
Node Imap
var Imap = require('imap'),
inspect = require('util').inspect;
var imap = new Imap({
user: '[email protected]',
password: 'XXXXX',
host: 'imap.gmail.com',
port: 993,
secure: true
});
#!/bin/sh
DRONE_SSID="ardone_adam"
killall udhcpc
udhcpd /tmp/udhcpd.conf
ifconfig ath0 down
iwconfig ath0 mode Ad-Hoc essid $DRONE_SSID channel auto commit
ifconfig ath0 192.168.1.1 netmask 255.255.255.0 up
@AdamMagaluk
AdamMagaluk / gist:5224544
Created March 22, 2013 20:37
Alsa_in for usb audio card
/usr/bin/alsa_in -j "USB 1" -d hw:default -q 1
@AdamMagaluk
AdamMagaluk / Making media card.md
Last active December 16, 2015 03:59
Gumstix writing mmc to nand

#Creating media cards

  1. Open Applications->Intellistreets->Gparted in main application menu. If instructed login with normal credentials.

  2. Switch devices on the top right dropdown box to /dev/sdb or similair. Will be one with ~2GB. You may have to refresh by Ctl-R if you removed and inserted a new card.

  3. Click on any partitions and click delete until you are left with a completely unallocated device.

  4. Click Partition->New

@AdamMagaluk
AdamMagaluk / water.js
Last active December 21, 2015 21:19
Watermark Images Node.js
var exec = require('child_process').exec;
function watermark(base,marker,output,callback){
var command = [
'composite',
'-watermark', '1x1',
'-gravity', 'center',
'-quality', 100,
marker,
base,
@AdamMagaluk
AdamMagaluk / blink.js
Last active December 22, 2015 00:39
2013 Arduino Class code
@AdamMagaluk
AdamMagaluk / workflow.md
Created September 17, 2013 14:40
Git Workflow

Git Work Flow

This document will describe our process or using Git and Gitlab for managing our software development.

Tutorial Format

All text blocks like the one below are intended to be ran from the command line or Git Shell on Windows.