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
@suda
suda / blink.ino
Last active Apr 28, 2016 — forked from brooksware2000/blink.ino
Example blink sketch
View blink.ino
View particle-libraries-v2.md

Particle Libraries v2

Abstract

Current user libraries architecture wasn't updated since its conception. Since then we added new tools (CLI and Dev), new boards and welcomed 3rd party module vendors in our ecosystem. All not anticipated when designing them. We want to revisit this with next version of our libraries.

Tools created for this purpose can be used outside our ecosystem i.e. with Arduino, Raspberry Pi.

Goals

@suda
suda / RCSwitch.cpp
Created Mar 18, 2014
RCSwitch for Spark Core
View RCSwitch.cpp
/* ========================= .cpp ================================= */
/*
RCSwitch - Arduino libary for remote control outlet switches
Copyright (c) 2011 Suat Özgür. All right reserved.
Contributors:
- Andre Koehler / info(at)tomate-online(dot)de
- Gordeev Andrey Vladimirovich / gordeev(at)openpyro(dot)com
- Skineffect / http://forum.ardumote.com/viewtopic.php?f=2&t=46
View request_bin.py
"""
Simple Gist for debugging Django requests using RequestBin (http://requestb.in/)
Usage:
from request_bin import request_bin
def index_view(request):
request_bin('http://requestb.in/1fpixiy1', request)
View query-synchronizer.js
/**
* Module allowing to use Azure Mobile Services database on server side
* in a synchronous manner.
*
* Singleton based on http://simplapi.wordpress.com/2012/05/14/node-js-singleton-structure/
*
* @example
* var synchronizer = require('query-synchronizer');
* synchronizer.read(table, function(results) {
* // Do something with the results
@suda
suda / bytesex.h
Created Oct 3, 2013
bytesex.h with AMD64 and x86_64 architectures
View bytesex.h
/* Original code from the Linux C library */
/* Copyright (C) 2000,2001 Salvatore Sanfilippo <antirez@invece.org>
* This code is under the original GNU C library license (GPL) */
/* $Id: bytesex.h,v 1.1.1.1 2003/08/31 17:23:48 antirez Exp $ */
#ifndef ARS_BYTESEX_H
#define ARS_BYTESEX_H
#if defined(__i386__) \
View bootstrap_chef.sh
#!/bin/bash
# Modified install.sh file from http://www.opinionatedprogrammer.com/2011/06/chef-solo-tutorial-managing-a-single-server-with-chef/
# This runs as root on the server
chef_binary=/usr/local/bin/chef-solo
# Are we on a vanilla system?
if ! test -f "$chef_binary"; then
export DEBIAN_FRONTEND=noninteractive
# Upgrade headlessly (this is only safe-ish on vanilla systems)
@suda
suda / multipleRows.mm
Last active Jun 14, 2019
Multiple Row Selection in UIPickerView
View multipleRows.mm
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
UITableViewCell *cell = (UITableViewCell *)view;
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
[cell setBackgroundColor:[UIColor clearColor]];
[cell setBounds:CGRectMake(0, 0, cell.frame.size.width - 20, 44)];
cell.tab = row UITapGestureRecognizer * singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(toggleSelection:)];
singleTapGestureRecognizer.numberOfTapsRequired = 1;
[cell addGestureRecognizer:singleTapGestureRecognizer];
}
@suda
suda / retina.sh
Created Dec 6, 2012
Check how much space Retina files (@2x) use up on your Mac's HDD
View retina.sh
#!/bin/bash
find /Applications/ -name "*@2x*" -exec ls -l {} \; | awk '{ total += $5 } END { total = total / 1024 / 1024; printf(" TOTAL SIZE OF RETINA FILES (MB): %4.2f\n", total)}'
@suda
suda / gist:2037819
Created Mar 14, 2012
Issue Stand Authorization
View gist:2037819

User authorization in Issue Stand magazines is done by sending username and password to a dedicated page on publisher's server (preferably HTTPS) and checking the result.

###POST Parameters Parameters are sent just like any HTML form.

  • username - username entered by the user
  • password - password entered by the user

###Server response Response is encoded in JSON format

You can’t perform that action at this time.