Skip to content

Instantly share code, notes, and snippets.

@jeantimex
jeantimex / actionlist.vim
Created February 24, 2020 22:01 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
@jeantimex
jeantimex / Three-Dimensional-BFS.js
Created March 15, 2019 06:42
Three-Dimensional BFS
/**
* @param {string[][]} maze
* @param {number[]} px
* @param {number} k
*/
const shortestPath = (maze, px, k) => {
const dx = [-1, 1, 0, 0];
const dy = [0, 0, -1, 1];
const m = maze.length;
@jeantimex
jeantimex / SwiftyLib.podspec
Last active February 24, 2019 23:53
SwiftyLib.podspec
Pod::Spec.new do |spec|
spec.name = "SwiftyLib"
spec.version = "0.0.1"
spec.summary = "A CocoaPods library written in Swift"
spec.description = <<-DESC
This CocoaPods library helps you perform calculation.
DESC
@jeantimex
jeantimex / .travis.yml with slater
Last active February 24, 2019 22:50
.travis.yml with slater
language: objective-c
osx_image: xcode10.1
env:
matrix:
- TEST_SDK=iphonesimulator12.1 OS=12.1 NAME='iPhone XR'
- TEST_SDK=iphonesimulator12.1 OS=12.1 NAME='iPhone 7'
script:
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -project SwiftyLib.xcodeproj -scheme SwiftyLib -sdk $TEST_SDK -destination "platform=iOS Simulator,OS=$OS,name=$NAME" ONLY_ACTIVE_ARCH=YES
@jeantimex
jeantimex / .slather.yml
Created February 24, 2019 22:45
.slather.yml
coverage_service: cobertura_xml
xcodeproj: SwiftyLib.xcodeproj
scheme: SwiftyLib
output_directory: reports
ignore:
- SwiftyLibTests/*
@jeantimex
jeantimex / SwiftyLib basic .travis.yml
Last active February 24, 2019 21:12
SwiftyLib .travis.yml file
language: objective-c
osx_image: xcode10.1
env:
matrix:
- TEST_SDK=iphonesimulator12.1 OS=12.1 NAME='iPhone XR'
- TEST_SDK=iphonesimulator12.1 OS=12.1 NAME='iPhone 7'
script:
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -project SwiftyLib.xcodeproj -scheme SwiftyLib -sdk $TEST_SDK -destination "platform=iOS Simulator,OS=$OS,name=$NAME" ONLY_ACTIVE_ARCH=YES
@jeantimex
jeantimex / SwiftyLibTests-complete.swift
Last active February 24, 2019 19:29
SwiftyLibTests.swift
//
// SwiftyLibTests.swift
//
import XCTest
@testable import SwiftyLib
class SwiftyLibTests: XCTestCase {
var swiftyLib: SwiftyLib!
@jeantimex
jeantimex / SwiftyLibTests.swift
Created February 24, 2019 19:16
SwiftyLibTests.swift - Part 1
//
// SwiftyLibTests.swift
//
import XCTest
@testable import SwiftyLib
class SwiftyLibTests: XCTestCase {
var swiftyLib: SwiftyLib!
@jeantimex
jeantimex / SwiftyLib.swift
Last active February 24, 2019 18:53
SwiftyLib.swift
//
// SwiftyLib.swift
//
public final class SwiftyLib {
let name = "SwiftyLib"
public func add(a: Int, b: Int) -> Int {
return a + b
@jeantimex
jeantimex / PromisAllWithFails.js
Created August 21, 2018 22:05 — forked from nhagen/PromisAllWithFails.js
Wait until all promises have completed even when some reject, with Promise.all
var a = ["sdfdf", "http://oooooolol"],
handleNetErr = function(e) { return e };
Promise.all(fetch('sdfdsf').catch(handleNetErr), fetch('http://invalidurl').catch(handleNetErr))
.then(function(sdf, invalid) {
console.log(sdf, invalid) // [Response, TypeError]
})
.catch(function(err) {
console.log(err);
})