Skip to content

Instantly share code, notes, and snippets.

View mayoralito's full-sized avatar
:octocat:
This is the way!

amayoral mayoralito

:octocat:
This is the way!
View GitHub Profile
@mayoralito
mayoralito / contact-form-shortcode.php
Created February 24, 2014 14:55
Form to include dynamically into your post with shortcode.
<?php
function drawContactForm($contactFor = 'personal'){
ob_start();
$randomName = generateRandomString();
?>
<form name="form-<?php echo $randomName; ?>" action="" method="post">
<div id="comment-input">
<div class="row">
#!/bin/sh
# xcode-build-number-generator.sh
# @desc Automaticvally create build number every time using curent day, month and year
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# xcode-build-bump.sh
# @desc Auto-increment the build number every time the project is run.
# @usage
# 1. Select: your Target in Xcode
# 2. Select: Build Phases Tab
# 3. Select: Add Build Phase -> Add Run Script
# 4. Paste code below in to new "Run Script" section
# 5. Drag the "Run Script" below "Link Binaries With Libraries"
# 6. Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
<?php
/**
* Copyright (c) 2013 Roman Ožana (http://omdesign.cz)
*
* For the full copyright and license information, please view
* the file license.txt that was distributed with this source code.
*
* @author Roman Ozana <ozana@omdesign.cz>
* @method Homepage()
* @method Homepage_actiom()
@mayoralito
mayoralito / examples
Created January 10, 2015 21:56
examples
//
// ViewController.m
// DemoInterview
//
// Created by amayoral on 1/10/15.
// Copyright (c) 2015 vRoutes. All rights reserved.
//
#import "ViewController.h"
@mayoralito
mayoralito / AMTextField
Last active August 29, 2015 14:14
Objective C snippets
// .h file
#import <UIKit/UIKit.h>
@interface AMTextField : UITextField
@property (nonatomic, assign) UIEdgeInsets edgeInsets;
@end
// .m file
#import "AMTextField.h"
@mayoralito
mayoralito / fuckingblocksyntax.swift
Last active September 2, 2015 15:16
fuckingblocksyntax.com using Swift
// As a local variable:
// Objective C - http://fuckingblocksyntax.com/
returnType (^blockName)(parameterTypes) = ^returnType(parameters) {...};
As a property:
// Swift -
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
#!/usr/bin/python
# fix-xcode
# Rob Napier <robnapier@gmail.com>
# Script to link in all your old SDKs every time you upgrade Xcode
# Create a directory called /SDKs (or modify source_path).
# Under it, put all the platform directories:
# MacOSX.platform iPhoneOS.platform iPhoneSimulator.platform
# Under those, store the SDKs:
@mayoralito
mayoralito / global-.gitignore
Created October 5, 2013 17:06
Git is really good at keeping a perfect history of the changes to your files. That's a great quality to have when those files are code, but not so great when a bit of application configuration slips in.
We need to create a global .gitignore in our home.
```
$> touch ~/.gitignore
$> git config --global core.excludesfile ~/.gitignore
```
After that we need to open (your) editor
```