Skip to content

Instantly share code, notes, and snippets.

View unclesamer's full-sized avatar

Samer Hobeika unclesamer

View GitHub Profile
@JigsChanchiya
JigsChanchiya / suffixDate.mm
Last active January 28, 2016 02:52
date formatting with suffix
-(NSString *)StringFromDate:(NSDate *)DateLocal{
NSDateFormatter *prefixDateFormatter = [[[NSDateFormatter alloc] init] autorelease];
[prefixDateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[prefixDateFormatter setDateFormat:@"MMMM d., yyyy"];//June 13th, 2013
NSString * prefixDateString = [prefixDateFormatter stringFromDate:DateLocal];
NSDateFormatter *monthDayFormatter = [[[NSDateFormatter alloc] init] autorelease];
[monthDayFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
[monthDayFormatter setDateFormat:@"d"];
int date_day = [[monthDayFormatter stringFromDate:DateLocal] intValue];
@jacksenechal
jacksenechal / readscale.py
Last active January 24, 2019 16:51
Python script to read a USB scale in the Linux
#!/usr/bin/python
import os, time
import usb.core
import usb.util
import pygtk
pygtk.require('2.0')
import gtk
from sys import exit
import math