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
# | |
#ARUBA FTP FILE UPLOAD USING CURL | |
# | |
pasky$ curl -v -T uploadme.dat ftp://ftp.site.com/www.site.com/_backup/ --user username:p4ssw0rd | |
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
using UnityEngine; | |
using System.Collections; | |
public class Rotate : MonoBehaviour | |
{ | |
public GameObject objectToRotate; | |
public GameObject rotationOverlay; // optional | |
void OnMouseDrag () | |
{ |
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
void LoadHeavyData() | |
{ | |
// start timer | |
float startTime = Time.realtimeSinceStartup; | |
// sample heavy code... | |
[...] | |
// stop timer | |
float endTime = Time.realtimeSinceStartup; |
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
tell application id "com.apple.dt.Xcode" | |
activate | |
end tell | |
tell application "System Events" | |
tell process "Xcode" | |
click menu item "Run" of menu "Product" of menu bar item "Product" of menu bar 1 | |
end tell |
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
/* | |
MTB Speedometer 1.0 | |
- GPS module | |
- BLE 4 module | |
- 7 Segment display | |
- DHT sensor for temperature and humidity | |
(c) 2017 Alberto Pasca | |
*/ | |
#include <string.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
import UIKit | |
import Speech | |
protocol SpeechManagerProtocol { | |
func didTextRecognized(text: String) | |
} | |
class SpeechManager: NSObject { | |
private var speechRecognizer : SFSpeechRecognizer? |
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 UIKit | |
class BatteryVC: UIViewController { | |
var timer: Timer? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
UIDevice.current.isBatteryMonitoringEnabled = true |
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 AVFoundation | |
import MediaPlayer | |
// [...] | |
private func headphones() { | |
let currentRoute = AVAudioSession.sharedInstance().currentRoute | |
if currentRoute.outputs.count != 0 { | |
for description in currentRoute.outputs { |
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
func screenshotDetector() { | |
NotificationCenter.default.addObserver(forName: .UIApplicationUserDidTakeScreenshot, object: nil, queue: OperationQueue.main) { notification in | |
print("Screenshot taken!") | |
} | |
} |
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 UIKit | |
class BrightnessVC: UIViewController { | |
var timer: Timer? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
timer = Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { (t) in |