Skip to content

Instantly share code, notes, and snippets.

Juan Felipe Alvarez Saldarriaga nebiros

Block or report user

Report or block nebiros

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nebiros
nebiros / Podfile
Created Oct 2, 2018
Set swift version for a specific pod
View Podfile
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
View LayoutableButton.swift
import UIKit
enum LayoutableButtonVerticalAlignment: String {
case center
case top
case bottom
case unset
}
enum LayoutableButtonHorizontalAlignment: String {
@nebiros
nebiros / BaseGeolocable.swift
Last active Jan 5, 2017
BaseGeolocable example
View BaseGeolocable.swift
//
// 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 Sep 20, 2016
Swift 3 – Resolving method ambiguity defining closures as a var
View test1.swift
// 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
}
View job_position_ios.md

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 Oct 13, 2016 — forked from anonymous/job_offerings.md
How to post job offerings
View job_position_frontend.md

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 Oct 27, 2015 — forked from nolanlawson/completion-for-gradle.md
Gradle tab completion for Bash. Works on both Mac and Linux.
View completion-for-gradle.md

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 Apr 23, 2014
takes a screenshot from some html element with html2canvas.js and save it to server with PHP.
View html2canvas.js
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);
});
}
});
@nebiros
nebiros / _get_short_url.php
Created Apr 23, 2014
URL shortener using google's and CURL.
View _get_short_url.php
<?php
define("DEFAULT_URL_SHORTENER_API_URL", "https://www.googleapis.com/urlshortener/v1/url");
function _get_short_url($longUrl) {
$curl = curl_init();
$options = array(
CURLOPT_CONNECTTIMEOUT => 0,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
@nebiros
nebiros / _create_url.php
Created Apr 23, 2014
builds current url, like http://blah.com/some/folders/inside, https://blah.com or create a new one using a path and a query string.
View _create_url.php
<?php
function _create_url($uri = null) {
$url = "http";
switch (true) {
case (isset($_SERVER["HTTPS"]) && ($_SERVER["HTTPS"] == "on" || $_SERVER["HTTPS"] === true)):
case (isset($_SERVER["HTTP_SCHEME"]) && ($_SERVER["HTTP_SCHEME"] == "https")):
case (isset($_SERVER["SERVER_PORT"]) && ($_SERVER["SERVER_PORT"] == 443)):
$url .= "s";
You can’t perform that action at this time.