Skip to content

Instantly share code, notes, and snippets.

View gauravkeshre's full-sized avatar

Gaurav K gauravkeshre

View GitHub Profile
@jpalala
jpalala / react_samples_list.md
Last active November 12, 2024 04:10 — forked from leecade/react_samples_list.md
React Samples List
@skreutzberger
skreutzberger / sen_swiftbe_dev.md
Last active December 2, 2019 15:07
Senior Swift Backend Developer (Freelance, 100% Remote)

Senior Swift Backend Developer (Freelance, 100% Remote)

I am searching experienced backend developers (freelance, remote) with a ❤️ for Swift for Moonshot Energy, the world’s first AI-driven renewable energy company located in Germany. Moonshot Energy is financially backed by Innogy SE, one of Europe's largest energy providers.

At Moonshot you will play a major role in making the world greener, the future brighter and energy distribution smarter by using latest technologies like server-side Swift, microservices, artificial intelligence 🤖 and machine learning and new interfaces like chatbots and dialog-based systems (NLP).

Since our team is working on European timezones it would be good if you would live in the EU or if you are an early bird living in US-East 🇪🇺🇺🇸.

Your job:

  • build our internal microservices
@externvoid
externvoid / uncaughtedException.swift
Last active April 22, 2019 08:40
Uncaught Exceptionをlogへ保存する
// case 1
//AppDelegate#application:didFinishLaunchingWithOptions
NSSetUncaughtExceptionHandler {e in
print(">>>>> ExceptionHandler OK")
let log = NSString(format:"%@, %@", e.name, e.reason!)
NSUserDefaults.standardUserDefaults().setValue(log, forKey: "failLog")
}
// case 2
// Closureを渡さなくても、swift関数の関数名を渡しても良い。ただし、NSSetUncaughtExceptionHandlerと同じスコープ内に
// swift関数が無いとコンパイルエラー⁉️
[UIView animateKeyframesWithDuration:5.0 delay:0.0 options:0 animations:^{
[UIView addKeyframeWithRelativeStartTime:0.0 relativeDuration:0.5 animations:^{
self.verticalPosition.constant = 200.0;
[self.view layoutIfNeeded];
}];
[UIView addKeyframeWithRelativeStartTime:0.5 relativeDuration:0.25 animations:^{
self.verticalPosition.constant = 50.0;
[self.view layoutIfNeeded];
}];
[UIView addKeyframeWithRelativeStartTime:0.75 relativeDuration:0.125 animations:^{
@atsepkov
atsepkov / universal-framework.sh
Last active February 18, 2021 06:26 — forked from cromandini/universal-framework.sh
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures). This version works with Cocoapods, merging simulator and device architectures for intermediate libraries as well. To use this script, go to Product > Scheme > Edit S…
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
@FranDepascuali
FranDepascuali / AssociatedObjects.swift
Last active April 7, 2022 18:37
Full implementation
private var AssociatedKey: UInt = 0
private final class AssociatedObjectBox<T> {
let value: T
init(_ x: T) {
value = x
}
}
anonymous
anonymous / method-chaining.swift
Created October 19, 2015 21:57
Method Chaining
// MARK: Method chaining
class MethodChainig {
func fetchImage() -> Fetch<UIImage> {
let fetch = Fetch<UIImage>()
return fetch
}
}
@samuelbeek
samuelbeek / constants.swift
Last active October 21, 2015 18:55
Constants in Swift
// My way of doing constants in Swift.
// Usage example: if(Constants.debug) { println("debug message") }
struct Constants {
// App wide things:
static let debug = true
static let production = true
static let appVersion = "iOS-0.1.0b300"
static let apiBase = "http://api.com/1"
@vollkorn
vollkorn / gist:61596aeea691691c0fed
Last active October 20, 2017 07:43
LLVM Cheat sheet

Print which passes are used in -O1, -O2, -O3...

opt -O2 -debug-pass=Arguments foo.ll -S -o bar.ll

Show control flow graph using opt, spawning a new background task.

opt -view-cfg -view-background foo.ll

Debugging mit gdb

@ccabanero
ccabanero / Sample iOS Unit Tests: Working with a ViewController composed of TableViews
Last active November 9, 2023 09:00
Sample iOS Unit Tests: Working with a ViewController composed of TableViews
import XCTest
@testable import YourAppTargetname
class SideMenuViewControllerTest: XCTestCase {
var viewControllerUnderTest: SideMenuViewController!
override func setUp() {
super.setUp()