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 Photos | |
struct UnexpectedNilError: Error {} | |
extension PHImageManager { | |
func requestImage( | |
for asset: PHAsset, | |
targetSize: CGSize, | |
contentMode: PHImageContentMode, | |
options: PHImageRequestOptions? |
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
#!/bin/bash | |
echo "🤔 Enter a video name:" | |
read name | |
name="${name}.mp4" | |
echo | |
echo "📹 Recording $name" | |
echo |
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
Martin is creating a iOS app that will check if a user exists and an API to fetch the data associated with respective phone number. Allows you to upload thumbnails. (see below for agenda) | |
-------------------------- | |
Programming Language: Swift | |
-------------------------- | |
Are you using SwiftUI? | |
UIKit | |
-------------------------- | |
What's On The Agenda (Detailed) ? | |
LOGIN |
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 you use Storyboard, don't forget to set UIlabel to PaddingLabel | |
*/ | |
import UIKit | |
class PaddingLabel: UILabel { | |
var topInset: CGFloat | |
var bottomInset: CGFloat |
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
package main | |
import ( | |
"crypto/tls" | |
"encoding/base64" | |
"fmt" | |
"io/ioutil" | |
"log" | |
"net/smtp" | |
"strings" |
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 java.io.DataOutputStream; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import java.net.Socket; | |
public class Client { | |
public static void main(String[] args) throws IOException { | |
// need host and port, we want to connect to the ServerSocket at port 7777 | |
Socket socket = new Socket("localhost", 7777); | |
System.out.println("Connected!"); |
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
// Use tableView(_:didSelectRowAt:) to manage what happens when a user selects a UITableViewCell. | |
// This example exhibits how this app makes use of this method. | |
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | |
// Determine what to do when a cell in a particular section is selected. | |
switch indexPath.section { | |
case 0: | |
// If the cell in the first section is selected, this will trigger the segue with the "toHeightForRowAt" identifier | |
self.performSegue(withIdentifier: "toHeightForRowAt", sender: nil) |
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
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
NewerOlder