Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Gomez danielgomezrico

View GitHub Profile
@rsaunders100
rsaunders100 / alert.m
Created Sep 19, 2011
(iOS) UIAlert View Example - Has a delegate for Yes/No Taps Will only display popup once
View alert.m
- (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 Feb 18, 2012 — forked from slayer/rbenv-install-system-wide.sh
rbenv install and system wide install on Ubuntu to /opt/rbenv
View rbenv-install-system-wide.sh
# 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 Jun 7, 2021
Creating a Happy Git Environment on OS X
View happy_git_on_osx.md

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 Nov 6, 2016
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.
View UIScrollView+PullToRefresh.m
//
// 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 Mar 14, 2013
Gradle - force transitive dependency version for some group
View build.gradle
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 Jun 8, 2021
CircleTransform for Picasso
View CircleTransform.java
/*
* 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 Jun 4, 2021
A git pre commit hook that runs the test task with the gradle wrapper
View pre-commit.sh
#!/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 Jul 31, 2013
Methods for generating ISO 8601 timestamps in Java/Android
View TimestampUtils.java
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 Sep 5, 2019
Theme.AppCompat.Light.NoActionBar
View styles_noactionbar.xml
<?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 Apr 29, 2021
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]