Skip to content

Instantly share code, notes, and snippets.

View nishabe's full-sized avatar

nish abe nishabe

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.folderbackup.job</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
@nishabe
nishabe / README.md
Last active March 13, 2018 20:35 — forked from jonathantneal/README.md
Local SSL websites on macOS High Sierra

Local SSL websites on macOS High Sierra

These instructions will guide you through the process of setting up local, trusted websites on your own computer.

These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.

NOTE: You may substitute the edit command for nano, vim, or whatever the editor of your choice is. Personally, I forward the edit command to Sublime Text:

alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
\curl -sSL https://get.rvm.io | bash -s stable –ruby 
rvm install 2.4.2 
rvm use 2.4.2
gem install sinatra
/* Arduino IOT - Temperature (oC) and Humidity (%) on the web
*Use the DHT-22 sensor to read temperature and humidity values
*Send these values to www.thingSpeak.com with the ESP8266 serial Wifi module
Dev: Michalis Vasilakis // Date:23/2/2016 // Update: 25/2/2015 // Ver. 1.3
More info: http://www.ardumotive.com/iot-wifi-temp-and-humidity.html
Tip: open the serial monitor for debugging */
//Libraires
#include <stdlib.h>
#include <DHT.h>
@nishabe
nishabe / OBJC:Calling Web service using NSURLRequest & Blocks
Last active August 12, 2018 18:19
OBJC:Calling Web service using NSURLRequest & Blocks
- (IBAction)fetchGreeting;
{
NSURL *url = [NSURL URLWithString:@"http://rest-service.guides.spring.io/greeting"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[NSURLConnection sendAsynchronousRequest:request
queue:[NSOperationQueue mainQueue]
completionHandler:^(NSURLResponse *response,
NSData *data, NSError *connectionError)
{
@nishabe
nishabe / OBJC:UIAlertController : 'UIAlertView' is deprecated, use UIAlertController with a preferredStyle
Last active August 12, 2018 18:19
OBJC:UIAlertController : 'UIAlertView' is deprecated, use UIAlertController with a preferredStyle
// UIAlertController example. 'UIAlertView' is deprecated: first deprecated in iOS 9.0 - UIAlertView is deprecated.
// Use UIAlertController with a preferredStyle of UIAlertControllerStyleAlert instead
// More at: http://useyourloaf.com/blog/uialertcontroller-changes-in-ios-8/
- (void) handleError{
UIAlertController *alertController = [UIAlertController
alertControllerWithTitle:nil
message:@"Incorrect Credentials"
preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction
actionWithTitle:NSLocalizedString(@"OK", @"OK action")
@nishabe
nishabe / OBJC:Calling Web service using NSURLSession & Blocks
Last active August 12, 2018 18:19
OBJC:Calling Web service using NSURLSession & Blocks
// More at http://code.tutsplus.com/tutorials/networking-with-nsurlsession-part-1--mobile-21394
// More samples at: http://hayageek.com/ios-nsurlsession-example/
- (void)viewDidLoad {
[super viewDidLoad];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithURL:[NSURL URLWithString:@"https://itunes.apple.com/search?term=apple&media=software"] completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];
NSLog(@"%@", json);
}];
@nishabe
nishabe / OBJC:Update UI from blocks.txt
Last active August 12, 2018 18:20
OBJC:Update UI from blocks
dispatch_async(dispatch_get_main_queue(), ^{
// This block will be executed asynchronously on the main thread.
});
@nishabe
nishabe / OBJC:UIAlertView example.txt
Last active August 12, 2018 18:20
OBJC:UIAlertView example
UIAlertView *alertView = [[UIAlertView alloc]
initWithTitle:@"DefaultStyle"
message:@"the default alert view style"
delegate:self
cancelButtonTitle:@"Cancel"
otherButtonTitles:@"OK", nil];
[alertView show];
@nishabe
nishabe / OBJC:GetLocalPathOfSpecificTypeFile.txt
Last active August 12, 2018 18:20
OBJC:Get local path of a specific type file
NSString *htmlFile = [[NSBundle mainBundle] pathForResource:@"localHtmlSample" ofType:@"html"];