Skip to content

Instantly share code, notes, and snippets.

View aaronpearce's full-sized avatar

Aaron Pearce aaronpearce

View GitHub Profile
@aaronpearce
aaronpearce / PHP Token Grabber
Created June 6, 2011 05:36
dAmntoken grabber using PHP
<?php
// Set vars
$os = PHP_OS;
$cid= 21;
$csecret= "dba44bb59a5b303dd3d66a13e3cd4665";
// OS Check for browser opening
if($os == "Darwin") {
exec("open 'https://www.deviantart.com/oauth2/draft15/authorize?client_id=".$cid."&redirect_uri=http://damnapp.com/apicode.php&response_type=code'");
} elseif($os == "WINNT") {
dAmnMobile Sunya
================
- SQLite Message Store
- UIWebView for Message View
- UITableView for Chat List, User List
- Store timestamps to show number of unread messages
- Show user's info on tap
- Allow viewing of deviations by interlinking with dA Mobile
- Backgrounding of the application
-(NSDictionary *)parser:(NSString *)packet:(NSInteger)depth {
NSMutableArray *partsArr = [NSMutableArray arrayWithArray:[packet componentsSeparatedByString:@"\n\n"]]; // Split by \n\n
NSMutableArray *headArr = [NSMutableArray arrayWithArray:[[partsArr objectAtIndex:0] componentsSeparatedByString:@"\n"]]; // Split by \n
[partsArr removeObjectAtIndex:0];
NSMutableArray *cmdArr = [NSMutableArray arrayWithArray:[[headArr objectAtIndex:0] componentsSeparatedByString:@" "]];
[headArr removeObjectAtIndex:0];
NSString *cmd = [cmdArr objectAtIndex:0];
0) #TheToyStore
1) #DrakenguardAcademy
2) #ToyStoreOOC
3) #WriteRoom
4) #DynastyOfHeroesRP
5) #InuyashaYYHRP
6) #lolwat
7) #NarutoWorldRP
8) #Ravemachine
9) #ShadowForestWolfPack
-(NSString *)avatarCreate:(NSString *)username:(int)num {
NSArray *extensions = [NSArray arrayWithObjects:@".gif", @".gif", @".jpg", @".png", nil];
int x = 3;
int y = 2;
int z = 15;
int cachebust = (num >> y) & z;
int tnum = num & x;
NSString *extension = [extensions objectAtIndex:tnum];
[{"chatname":"damnmobile","description":"The official room for dAmnMobile, the only iOS app to get on dAmn!"},{"chatname":"damnmobile","description":"The official room for dAmnMobile, the only iOS app to get on dAmn!"}]a
for (int i = 0; i < [[self tablumps] count]; i++) {
bodyString = [bodyString stringByReplacingOccurrencesOfString:[[self tablumps] objectAtIndex:i] withString:[[self tablumpsReplace] objectAtIndex:i]];
}
for (int j = 0; j < [[self tablumpsRegex] count]; j++) {
bodyString = [bodyString stringByReplacingOccurrencesOfRegex:[[self tablumpsRegex] objectAtIndex:j] withString:[[self tablumpsRegexReplace] objectAtIndex:j]];
bodyString = [bodyString stringByReplacingOccurrencesOfString:@":f" withString:@"/f"];
bodyString = [bodyString stringByReplacingOccurrencesOfString:@":i" withString:@"/i"];
Hi
I found your profile on dribble and I like your work.
My friend and I are starting up an online music streaming service (" a
Spotify for the African vertical) and would love some design help.
We are self funded therefore our budget is quite little. We would like
to have an idea of what your costs are.
As messages are received, update room's last message value to that timestamp. Then call the DB if this timestamp is higher than the current timestamp in that view.
Or...
Use notification center or a instance var to set timestamp of the newest message for the current view if it is a chat view.
Then the chat will compare this to it's last message and load the messages in if needed.
function addMessage(html) {
var li = document.createElement('li');
var list = document.getElementByID('list');
li.innerHTML= unescape(html);
alert(unescape(html));
list.appendChild(li);
alert('test');
}