Skip to content

Instantly share code, notes, and snippets.

View milankamilya's full-sized avatar
👋
open to work

Milan Kamilya milankamilya

👋
open to work
View GitHub Profile
@jkereako
jkereako / ReCAPTCHAViewController.swift
Created September 8, 2020 13:15
ReCAPTCHA v2 in Swift
import UIKit
import WebKit
final class ReCAPTCHAViewController: UIViewController {
private var webView: WKWebView!
private let viewModel: ReCAPTCHAViewModel
init(viewModel: ReCAPTCHAViewModel) {
self.viewModel = viewModel
protocol HTTPClientService {
/**
Sends a 'get' request to a specified URL
- Parameter url: String of URL
- Returns: Optional observable Data type
*/
func get(url: String) -> Observable<Data?>
/**
@jeroen-meijer
jeroen-meijer / .gitignore
Created September 12, 2018 04:47
General Flutter .gitignore (including VS Code, IntelliJ & Firebase files).
### https://raw.github.com/github/gitignore/80a8803b004013d17291196825a327b9e871f009/Android.gitignore
# Built application files
*.apk
*.ap_
# Files for the ART/Dalvik VM
*.dex
# Java class files
import Foundation
import UIKit
import Intents
import CoreSpotlight
import CoreServices
@IBAction func donate() {
// perform an actual order here
@wbroek
wbroek / Fastfile
Last active October 8, 2019 10:19
HockeyApp lane for Fastlane for iOS
default_platform :ios
platform :ios do
desc "Submit a new Beta Build to Hockey App"
lane :beta do
if !is_ci?
changelog = prompt(text: "Please enter what's changed in one sentenence: ")
end
increment_build_number
@blankg
blankg / WebViewBridge.js
Last active July 12, 2022 06:53
For RN >= 0.57 please look at https://github.com/blankg/rn-webview-bridge-sample-new/blob/master/resources/index.html. Provides a sample implementation for sending and receiving messages to and from the React-Native WebView (using postMessage/onMessage WebView API).
/**
* Created by Guy Blank on 3/9/17.
*
* This is a sample provides an API to send & receive messages to and from the React-Native WebView (using postMessage/onMessage WebView API).
* A sample project that uses the bridge is available here https://github.com/blankg/rn-webview-bridge-sample
*
* webViewBridge.send('functionToInvoke', {mydata: 'test'}, function(){console.log('success')},function(){console.log('error')});
*
* The API is designed to be similar to the Cordova exec API so migration to it should be almost seamless.
* The API also provides solution to a React-Native WebView bug in iOS which causes sending consecutive postMessage calls to override each other.
@lucasscariot
lucasscariot / model-user.js
Last active June 22, 2023 17:08
Composite Primary Key in Sequelize
/*
* Migration
*/
'use strict';
module.exports = {
up: function(queryInterface, Sequelize) {
return queryInterface.createTable('Users', {
firstName: {
type: Sequelize.STRING
},
@grzegorzkrukowski
grzegorzkrukowski / CALayer+Pause.swift
Created May 12, 2017 10:34
Solving the problem of CALayer animations being removed when application goes to background
//
// CALayer+Pause.swift
//
// Created by Grzegorz Krukowski on 11/05/2017.
// Copyright © 2017. All rights reserved.
//
import Foundation
extension CALayer {
@candostdagdeviren
candostdagdeviren / pre-commit
Last active April 22, 2023 09:32
Git Pre-Commit hook with SwiftLInt
#!/bin/bash
#Path to swiftlint
SWIFT_LINT=/usr/local/bin/swiftlint
#if $SWIFT_LINT >/dev/null 2>&1; then
if [[ -e "${SWIFT_LINT}" ]]; then
count=0
for file_path in $(git ls-files -m --exclude-from=.gitignore | grep ".swift$"); do
export SCRIPT_INPUT_FILE_$count=$file_path
@Sorix
Sorix / AsynchronousOperation.swift
Last active May 22, 2024 07:15
Subclass of NSOperation (Operation) to make it asynchronous in Swift 3, 4, 5
// Created by Vasily Ulianov on 09.02.17, updated in 2019.
// License: MIT
import Foundation
/// Subclass of `Operation` that adds support of asynchronous operations.
/// 1. Call `super.main()` when override `main` method.
/// 2. When operation is finished or cancelled set `state = .finished` or `finish()`
open class AsynchronousOperation: Operation {
public override var isAsynchronous: Bool {