This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http') | |
http.createServer(function (req,res) { | |
res.writeHead(200, {'Content-Type':'text/plain'}); | |
res.end('Hello World! \n'); | |
}).listen(1337,"127.0.0.1"); | |
console.log('Server running ar http://127.0.0.1:1337//'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var url = require('url'); | |
var fs = require('fs'); | |
var newPostFormHTML = fs.readFileSync('views/post/new.html'); | |
function renderNewPostForm(request, response) { | |
response.writeHead(200, { | |
'Content-type': 'text/html; charset=utf-8' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <sys/sysctl.h> | |
- (NSArray *)runningProcesses { | |
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0}; | |
size_t miblen = 4; | |
size_t size; | |
int st = sysctl(mib, miblen, NULL, &size, NULL, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mib[0] = CTL_KERN; | |
mib[1] = KERN_PROC; | |
mib[2] = KERN_PROC_ALL; | |
mib[3] = 0; | |
ret = sysctl(mib, 4, NULL, &size, NULL, 0); | |
procs = malloc(size); | |
ret = sysctl(mib, 4, procs, &size, NULL, 0); /* procs is struct kinfo_proc.*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface UIDevice (ProcessesAdditions) | |
- (NSArray *)runningProcesses; | |
@end | |
// .m | |
#import <sys/sysctl.h> | |
@implementation UIDevice (ProcessesAdditions) | |
- (NSArray *)runningProcesses { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/sysctl.h> | |
@interface UIDevice(Hardware) | |
- (NSString *) platform; | |
- (BOOL)hasRetinaDisplay; | |
- (BOOL)hasMultitasking; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//If it dont simulator : | |
#if !TARGET_IPHONE_SIMULATOR | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - UIPickerViewDelegate methods | |
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component | |
{ | |
} | |
#pragma mark - UIPickerViewDataSource methods | |
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// DetailViewController.h | |
// youtubedemo | |
// | |
// Created by Your Name on 4/24/12. | |
// Copyright (c) 2012 Company Name. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <openssl/pkcs7.h> | |
#include <openssl/x509.h> | |
#include <openssl/bio.h> | |
#include <openssl/pem.h> | |
int main(int argc, char **argv) | |
{ | |
PKCS7 *p7 = NULL; | |
BIO *in = BIO_new(BIO_s_file()); |
OlderNewer