This file contains hidden or 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 ( | |
"fmt" | |
lz "github.com/Albinzr/lzGo" | |
"github.com/pkg/errors" | |
"log" | |
"net/http" | |
_ "net/http/pprof" | |
) |
This file contains hidden or 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
//: # Swift 3: URLSessionDelegate | |
//: The following example shows how to use `OperationQueue` to queue the network requests. This is useful in many ways (for delaying queued requests when the networking goes down for example) | |
import Foundation | |
import PlaygroundSupport | |
class Requester:NSObject { | |
let opQueue = OperationQueue() | |
var response:URLResponse? |
This file contains hidden or 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 ( | |
"io" | |
"log" | |
"os" | |
"os/exec" | |
"io/ioutil" | |
"bytes" | |
) |
This file contains hidden or 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
deploy-prod: | |
variables: | |
GIT_STRATEGY: none | |
stage: deploy | |
only: | |
- master | |
script: | |
- sudo -u $PROJ_OWNER git --git-dir=$DEPLOY_DIR/.git --work-tree=$DEPLOY_DIR fetch origin $CI_COMMIT_REF_NAME | |
- sudo -u $PROJ_OWNER git --git-dir=$DEPLOY_DIR/.git --work-tree=$DEPLOY_DIR reset --hard FETCH_HEAD | |
- sudo -H -u $PROJ_OWNER chmod u+x $DEPLOY_DIR/nodescripts.sh |
This file contains hidden or 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
variables: | |
GCP_PROJECT_ID: {YOUR GOOGLE CLOUD PROJECT ID} | |
GCP_ZONE: us-central1-a | |
services: | |
- docker:dind | |
stages: | |
- npm-install | |
- push |
This file contains hidden or 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 | |
# Adapted from http://stackoverflow.com/questions/24039470/xcode-6-ios-creating-a-cocoa-touch-framework-architectures-issues/26691080#26691080 | |
# and https://gist.github.com/cromandini/1a9c4aeab27ca84f5d79 | |
# Create a new aggregate target. | |
# For the automatically generated scheme, change its build config to "release". | |
# Ensure this target's "product name" build setting matches the framework's. | |
# Add a run script with `source "${PROJECT_DIR}/path_to_this_script` |
This file contains hidden or 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 Foundation | |
var a = [1, 3, 6, 4, 1, 2] | |
var b = [1,2,3] | |
var c = [-1,-2,-3] | |
func findNearestMissingSmallValue(numberArray:[Int]) -> Int{ | |
var b = numberArray.sorted() | |
var smallestValue:Int? |
This file contains hidden or 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
# Builds a Exiv2 framework for the iPhone and the iPhone Simulator. | |
# Creates a set of universal libraries that can be used on an iPhone and in the | |
# iPhone simulator. Then creates a pseudo-framework to make using libexiv2 in Xcode | |
# less painful. | |
# | |
# To configure the script, define: | |
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1) | |
# | |
# Then go get the source tar.bz of the libexiv2 you want to build, shove it in the | |
# same directory as this script, and run "./libexiv2.sh". Grab a cuppa. And voila. |
This file contains hidden or 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
# Builds a ZThread framework for the iPhone and the iPhone Simulator. | |
# Creates a set of universal libraries that can be used on an iPhone and in the | |
# iPhone simulator. Then creates a pseudo-framework to make using libzthread in Xcode | |
# less painful. | |
# | |
# To configure the script, define: | |
# IPHONE_SDKVERSION: iPhone SDK version (e.g. 8.1) | |
# | |
# Then go get the source tar.bz of the libzthread you want to build, shove it in the | |
# same directory as this script, and run "./libzthread.sh". Grab a cuppa. And voila. |
NewerOlder