Skip to content

Instantly share code, notes, and snippets.

View nebiros's full-sized avatar

Juan Alvarez nebiros

View GitHub Profile
const Hapi = require('@hapi/hapi');
const MongoClient = require('mongodb').MongoClient;
const server = Hapi.server({
port: 3000,
debug: {
request: ['*']
}
});
@nebiros
nebiros / main.go
Created April 9, 2020 20:08
[SOLVED] Write a minimal thread pool using go routines and channels
package main
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
@nebiros
nebiros / Podfile
Created October 2, 2018 01:35
Set swift version for a specific pod
post_install do |installer|
installer.pods_project.targets.each do |target|
next unless %w[NonSwift42Pod].include? target.name
target.build_configurations.each do |config|
config.build_settings["SWIFT_VERSION"] = "4.0"
end
end
end
import UIKit
enum LayoutableButtonVerticalAlignment: String {
case center
case top
case bottom
case unset
}
enum LayoutableButtonHorizontalAlignment: String {
@nebiros
nebiros / BaseGeolocable.swift
Last active January 5, 2017 22:41
BaseGeolocable example
//
// BaseGeolocable.swift
//
// Created by Juan Felipe Alvarez Saldarriaga on 11/11/16.
//
import Foundation
import CoreLocation
protocol BaseGeolocable: class, CLLocationManagerDelegate {
@nebiros
nebiros / test1.swift
Last active September 20, 2016 18:13
Swift 3 – Resolving method ambiguity defining closures as a var
// objc's continue method signature: - (AWSTask *)continueWithBlock:(AWSContinuationBlock)block;
// swift translate it as: .continue(block: (AWSTask<AWSCognitoIdentityUserPoolSignUpResponse>) -> Any?)
// error: Ambiguous use of 'continue'
pool.signUp(username,
password: password,
userAttributes: attrs,
validationData: nil)
.continue { (task) -> Any? in
}

Batteries911

Oscar Correa: oscar@batteries911.com

Requerimientos

  • ios
  • objc
  • swift (no es necesario saberlo)
  • uikit

Salario: $1800 USD

@nebiros
nebiros / job_position_frontend.md
Last active October 13, 2016 18:05 — forked from anonymous/job_offerings.md
How to post job offerings

Batteries911

Oscar Correa: oscar@batteries911.com

Requerimientos

  • css
  • javascript
  • node.js
  • angular (al menos mid-level)

Salario: $1800 USD

@nebiros
nebiros / completion-for-gradle.md
Created October 27, 2015 16:08 — forked from nolanlawson/completion-for-gradle.md
Gradle tab completion for Bash. Works on both Mac and Linux.

Gradle tab completion script for Bash

A tab completion script that works for Bash. Relies on the BSD md5 command on Mac and md5sum on Linux, so as long as you have one of those two commands, this should work.

Usage

$ gradle [TAB]
@nebiros
nebiros / html2canvas.js
Created April 23, 2014 21:33
takes a screenshot from some html element with html2canvas.js and save it to server with PHP.
html2canvas(document.getElementById("an_element_id"), {
onrendered: function(canvas) {
var img = canvas.toDataURL("image/png");
$.post("http://blah.com", {image_data: img}, function (data, textStatus, jqXHR) {
console.log(arguments);
});
}
});