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
View FullWidthSelfSizingCollectionView.swift
import UIKit
import Cartography // https://github.com/robb/Cartography
/**
This is an example of self sizing `UICollectionView` cells using AutoLayout,
where the width of cells is always the width of the parent, to mimic `UITableView`.
*/
fileprivate let items: [String] = (0..<100)
.map { _ in Lorem.sentences(Int.random(min: 1, max: 8)) } // Using https://github.com/lukaskubanek/LoremSwiftum/blob/master/Sources/LoremSwiftum.swift
@laurenfazah
laurenfazah / authentication_with_express_postgres.md
Last active Feb 16, 2020
Authentication with an Express API and Postgres
View authentication_with_express_postgres.md

Authentication with an Express API and Postgres

Setting Up

Let's make sure our Express app has the required base modules:

# within root of API
npm install --save express pg knex bcrypt
npm install --save-dev nodemon
@dorner
dorner / cron.yaml
Last active Apr 1, 2019
How to execute code in Elastic Beanstalk only if you're the leader
View cron.yaml
# We are not using this file to run actual cron jobs. This is because the
# built-in Elastic Beanstalk cron feature actually puts the jobs at the end
# of the SQS queue. Instead we will run them manually. However, we need to
# have a non-empty cron.yaml or the SQS daemon won't even run and leader
# election won't work.
version: 1
cron:
- name: "DoNothingJob"
url: "/periodic_tasks"
schedule: "0 0 31 2 *"
@rsudip90
rsudip90 / nullHandle.go
Last active Jul 26, 2019
How I handled the null possible value in a sql database row in golang?
View nullHandle.go
package main
import (
"database/sql"
"encoding/json"
"fmt"
"reflect"
"time"
"github.com/go-sql-driver/mysql"
@abraithwaite
abraithwaite / config.go
Created Mar 15, 2017
Awesome way to do configuration in go. Taken from https://github.com/influxdata/telegraf
View config.go
package main
import (
"io/ioutil"
"log"
"github.com/naoina/toml"
"github.com/naoina/toml/ast"
)
@jonfhancock
jonfhancock / ExcellentAdventure.java
Last active May 14, 2019
This set of classes demonstrates what a Not Dumb ViewHolder should look like. It lightens the load on the Adapter, and places decisions about what to do with user interactions on the Activity where it belongs.
View ExcellentAdventure.java
public class ExcellentAdventure {
@Retention(SOURCE)
@StringDef({ERA_BC, ERA_AD})
public @interface Era {
}
public static final String ERA_BC = "BC";
public static final String ERA_AD = "AD";
@TrevorJTClarke
TrevorJTClarke / deploy_with_ebcli3_on_circleci.md
Last active Mar 9, 2017 — forked from RobertoSchneiders/deploy_with_ebcli3_on_circleci.md
Settings to deploy to AWS Elastic Beanstalk on CircleCi (EB Cli 3)
View deploy_with_ebcli3_on_circleci.md

Configure the deploy of AWS Elastic Beanstalk through CircleCI.

Configure Environments Variables

On Project Settings > Environment Variables add this keys:

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY
    The aws user must have the right permissions. This can be hard, maybe, this can help you.

Confirm Build Environment:

View RfcDateTimeParser.java
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.Locale;
// Gist
// https://gist.github.com/oseparovic/d9ee771927ac5f3aefc8ba0b99c0cf38
// Relevant SO question
View UserDefaultable.swift
//:
//: UserDefaultable.swift
//:
//: Created by Andyy Hope on 18/08/2016.
//: Twitter: @andyyhope
//: Medium: Andyy Hope, https://medium.com/@AndyyHope
import Foundation
// MARK: - Key Namespaceable
You can’t perform that action at this time.