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 / OBJC: Pulsing View Animation
Last active August 12, 2018 18:24
OBJC: Pulsing View Animation
-(void)showPulsingAnimation {
CABasicAnimation *theAnimation;
theAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"];
theAnimation.duration = 2.0;
theAnimation.repeatCount = HUGE_VALF;
theAnimation.autoreverses = YES;
theAnimation.fromValue = [NSNumber numberWithFloat:1.0];
theAnimation.toValue = [NSNumber numberWithFloat:0.0];
[self.pulsingView.layer addAnimation:theAnimation forKey:@"animateOpacity"];
}
@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 / SWIFT: AlertViewController
Created August 12, 2018 18:29
SWIFT: AlertViewController
let alert = UIAlertController(title: "Alert Title", message: "Alert Message", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { action in
switch action.style{
case .default:
print("default")
case .cancel:
print("cancel")
case .destructive:
print("destructive")
}}))
@nishabe
nishabe / SWIFT:Random Number Generation
Created August 12, 2018 18:50
SWIFT:Random Number Generation
let randomTasks = ["laundry","Grocery","Rent","Phone bill","Internet Bill","Excercise","Cycling","Cleaning"]
let randomNumber = arc4random_uniform(UInt32(randomTasks.count))
@nishabe
nishabe / SWIFT: Get Documents Directory Path
Created August 13, 2018 02:44
SWIFT: Get Documents Directory Path
public extension FileManager {
static var documentsDirectoryURL: URL {
return FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first!
}
}
let docUrl = FileManager.documentsDirectoryURL
or
let docUrl = try FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false)
@nishabe
nishabe / SWIFT: Set Tint for Application.swift
Created September 8, 2018 22:10
SWIFT: Set Tint for Application
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
// Configure Window
window?.tintColor = UIColor(red:0.99, green:0.47, blue:0.44, alpha:1.0)
return true
}
@nishabe
nishabe / unitTestSample.swift
Last active February 8, 2019 04:38
unitTestSample
// This test verfies the value of actual string is equal to the epected string
func test_behaviorBeingTested_contextItsTestedUnder() {
// Given
let objectUnderTest = SomeClass()
// When
objectUnderTest.performSomeAction()
let expected: String = "The expected change"
let actual: String = objectUnderTest.text
// Then
XCTAssertEqual(expected, actual)