Skip to content

Instantly share code, notes, and snippets.

View danielgomezrico's full-sized avatar

Daniel Gomez danielgomezrico

View GitHub Profile
@rsaunders100
rsaunders100 / alert.m
Created September 19, 2011 09:35
(iOS) UIAlert View Example - Has a delegate for Yes/No Taps Will only display popup once
- (void) showConfirmationAlert
{
// A quick and dirty popup, displayed only once
if (![[NSUserDefaults standardUserDefaults] objectForKey:@"HasSeenPopup"])
{
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Question"
message:@"Do you like cats?"
delegate:self
cancelButtonTitle:@"No"
otherButtonTitles:@"Yes",nil];
@tomazzlender
tomazzlender / rbenv-install-system-wide.sh
Created February 18, 2012 14:22 — forked from slayer/rbenv-install-system-wide.sh
rbenv install and system wide install on Ubuntu to /opt/rbenv
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential
apt-get -y install git-core
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /opt/rbenv
# Add rbenv to the path:
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@kreeger
kreeger / UIScrollView+PullToRefresh.m
Last active November 6, 2016 17:15
Adds pull to refresh for a UIScrollView (or a UITableView). Abstracts away differences in frameworks between iOS 6 and iOS 5 (in the case of the latter, ODRefreshControl is used. Attempts to be as similar in fashion as possible to the interface set forth in SVPullToRefresh, with a couple of minor exceptions.
//
// UIScrollView+PullToRefresh.h
// Created by Ben Kreeger (@kreeger), 2013/01/23.
//
#import <UIKit/UIKit.h>
/** Adds pull to refresh for a UIScrollView (or a UITableView). Abstracts away differences in frameworks between iOS 6
* and iOS 5 (in the case of the latter, `ODRefreshControl` is used.
*/
@michail-nikolaev
michail-nikolaev / build.gradle
Created March 14, 2013 15:01
Gradle - force transitive dependency version for some group
apply plugin: 'java'
configurations.all {
resolutionStrategy {
eachDependency { DependencyResolveDetails details ->
//specifying a fixed version for all libraries with 'org.gradle' group
if (details.requested.group == 'org.springframework') {
details.useVersion "$springVersion"
}
}
@julianshen
julianshen / CircleTransform.java
Last active November 6, 2023 12:47
CircleTransform for Picasso
/*
* Copyright 2014 Julian Shen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@chadmaughan
chadmaughan / pre-commit.sh
Last active November 25, 2022 00:38
A git pre commit hook that runs the test task with the gradle wrapper
#!/bin/sh
# this hook is in SCM so that it can be shared
# to install it, create a symbolic link in the projects .git/hooks folder
#
# i.e. - from the .git/hooks directory, run
# $ ln -s ../../git-hooks/pre-commit.sh pre-commit
#
# to skip the tests, run with the --no-verify argument
# i.e. - $ 'git commit --no-verify'
@kristopherjohnson
kristopherjohnson / TimestampUtils.java
Created July 31, 2013 18:20
Methods for generating ISO 8601 timestamps in Java/Android
package net.kristopherjohnson.util;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
/**
* Methods for dealing with timestamps
@tshrkmd
tshrkmd / styles_noactionbar.xml
Last active November 3, 2022 09:58
Theme.AppCompat.Light.NoActionBar
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.AppCompat.Light.NoActionBar" parent="@style/Theme.AppCompat.Light">
<item name="android:windowNoTitle">true</item>
<item name="windowActionBar">false</item> <!-- For 2.x version -->
</style>
</resources>
@nolanlawson
nolanlawson / completion-for-gradle.md
Last active April 5, 2024 07:43
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]