Skip to content

Instantly share code, notes, and snippets.

View beloso's full-sized avatar

Tiago Veloso beloso

View GitHub Profile
@beloso
beloso / flat-swift4-noncaching.stencil
Created May 8, 2018 16:04
SwiftGen non caching Strings template
// Generated using SwiftGen, by O.Halligon — https://github.com/SwiftGen/SwiftGen
{% if tables.count > 0 %}
{% set accessModifier %}{% if param.publicAccess %}public{% else %}internal{% endif %}{% endset %}
import Foundation
// swiftlint:disable superfluous_disable_command
// swiftlint:disable file_length
{% macro parametersBlock types %}{% filter removeNewlines:"leading" %}
{% for type in types %}
@beloso
beloso / RLMObject_(CYUtils).m
Last active February 15, 2017 10:15
Realm Utilities (Helping for crash log)
#import "RLMObject+MYUtils.h"
@interface RLMObject ()
+ (NSPredicate *)basePredicate;
@end
@implementation RLMObject (CYUtils)
@beloso
beloso / auth-basic.conf
Created April 3, 2016 11:28 — forked from Thermionix/auth-basic.conf
nginx reverse proxy for sickbeard, couchpotato etc.
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/htpasswd;
@beloso
beloso / OCLint Jenkins
Created January 7, 2016 10:30 — forked from SergioEstevao/OCLint Jenkins
A script for running OCLint in Jenkins and create PMD reports
#import path
export PATH=${PATH}:/usr/local/bin
#import what we have in bash_profile
source ~/.bash_profile
#check for oclint
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi
@beloso
beloso / OnSwipeTouchListener.java
Created June 25, 2015 16:56
android-on-swipe-listener
import android.view.GestureDetector;
import android.view.GestureDetector.SimpleOnGestureListener;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
public class OnSwipeTouchListener implements OnTouchListener {
private final GestureDetector gestureDetector;
#!/usr/bin/python
# -*- coding: utf-8 -*-
####################################################################################
## INFORMATION
####################################################################################
## Developed by: Steven Johnson (minor modifications by egretsareherons)
## (a minor modifications by aross01)
## (a minor modification by STEEVo)
##
## Last Updated: 02/26/2014 5:05PM MST
//
// KenBurnsView.m
// KenBurns
//
// Created by Javier Berlana on 9/23/11.
// Copyright (c) 2011, Javier Berlana
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this
// software and associated documentation files (the "Software"), to deal in the Software
// without restriction, including without limitation the rights to use, copy, modify, merge,
@beloso
beloso / gist:949999
Created April 30, 2011 21:12
Users controller
class UsersController < ApplicationController
# GET /users
# GET /users.xml
def index
@users = User.order("(clicks_given - clicks_received) DESC")
session[:current_user] = nil
@title = "Listing Users"
respond_to do |format|