Skip to content

Instantly share code, notes, and snippets.

View nedimf's full-sized avatar
🔥
building blazing.report - reimagine mobile analytics

Nedim nedimf

🔥
building blazing.report - reimagine mobile analytics
View GitHub Profile
@sindresorhus
sindresorhus / PHImageManager-requestImage-async.swift
Created November 3, 2021 05:46
How to use `PHImageManager#requestImage` with async/await in Swift.
import Photos
struct UnexpectedNilError: Error {}
extension PHImageManager {
func requestImage(
for asset: PHAsset,
targetSize: CGSize,
contentMode: PHImageContentMode,
options: PHImageRequestOptions?
@Kilo-Loco
Kilo-Loco / record-simulator.sh
Created August 4, 2020 20:11
Bash script for recording Xcode Simulator
#!/bin/bash
echo "🤔 Enter a video name:"
read name
name="${name}.mp4"
echo
echo "📹 Recording $name"
echo
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
@konnnn
konnnn / UILabel+Padding.swift
Last active February 22, 2024 13:24
Swift 4: Adding space/padding to a UILabel Programmatically and Storyboard
/*
If you use Storyboard, don't forget to set UIlabel to PaddingLabel
*/
import UIKit
class PaddingLabel: UILabel {
var topInset: CGFloat
var bottomInset: CGFloat
@guinso
guinso / main.go
Created October 9, 2017 02:07
Sample SMTP with attachment
package main
import (
"crypto/tls"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
"net/smtp"
"strings"
@chatton
chatton / SendStringOverSocket.java
Last active April 16, 2024 08:10
Example of sending a String through a Socket in Java.
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!");
@RNHTTR
RNHTTR / didSelectRowAtIndexPath.swift
Created September 23, 2017 20:01
An example of how to use tableView(_:didSelectRowAt:) to manage what happens when users select a UITableViewCell
// 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)
@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 24, 2024 06:51
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
@fgilio
fgilio / axios-catch-error.js
Last active April 11, 2024 19:02
Catch request errors with Axios
/*
* 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 😨