Skip to content

Instantly share code, notes, and snippets.

View coquer's full-sized avatar

Jorge Y. C. Rodriguez coquer

View GitHub Profile
@BayPhillips
BayPhillips / dumbuiviewcontroller
Last active June 8, 2017 13:17
A dumb Swift UIViewController with UITableView
import UIKit
class DumbViewController: UIViewController, UITableViewDataSource {
var items: [Int] = [Int]()
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.whiteColor()
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 2, 2025 06:20
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@olimortimer
olimortimer / gist:8801155
Created February 4, 2014 10:20
PHP: Replacement http_build_query
<?php
/**
* Recursive function to work through the data
*
* http_build_query in php 5 will screw up array serialisation by encoding the square brackets
* and make it incompatible for passing to an URL's GET segment or sending through post data manually
*
* Thanks to Marco K. (link below), A version intended for php < 5 actually encodes the data correctly
*
@jfloff
jfloff / mamp.md
Last active February 13, 2025 01:03
How to get MAMP to work with SSL ... Yes really.

First of all you need to be able to run MAMP in port 80. This is a "heat check" if you don't have any process jamming http ports. You can check it like this:

sudo lsof | grep LISTEN

If you do happen to have any process with something like this *:http (LISTEN), you are in trouble. Before with adventure check if it isn't MAMP itself (yeah, you should close that beforehand)

ps <pid of that process>

If you don't see MAMP, you are in good hands, I have just the thing for you:

@isGabe
isGabe / wp_custom_title_placeholder_text.php
Last active February 25, 2019 21:28
WordPress: Custom placeholder text for custom post type title input box #snippet #WordPress
<?php
/*
replacing the default "Enter title here" placeholder text in the title input box
with something more descriptive can be helpful for custom post types
place this code in your theme's functions.php or relevant file
source: http://flashingcursor.com/wordpress/change-the-enter-title-here-text-in-wordpress-963
*/
@matiaskorhonen
matiaskorhonen / gist:3013808
Created June 28, 2012 20:44
Chrome for iOS user-agents

Chrome for iOS user-agents

iPhone

Mozilla/5.0 (iPhone; U; CPU iPhone OS 5_1_1 like Mac OS X; en-gb)
AppleWebKit/534.46.0 (KHTML, like Gecko)
CriOS/19.0.1084.60 Mobile/9B206 Safari/7534.48.3

@cballou
cballou / get-ip-address-optimized.php
Created March 26, 2012 00:51
PHP - Advanced Method to Retrieve Client IP Address
<?php
function get_ip_address() {
$ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR');
foreach ($ip_keys as $key) {
if (array_key_exists($key, $_SERVER) === true) {
foreach (explode(',', $_SERVER[$key]) as $ip) {
// trim for safety measures
$ip = trim($ip);
// attempt to validate IP
if (validate_ip($ip)) {
@ashleydw
ashleydw / ThinklePaginator.js
Last active October 1, 2015 03:18
Thinkle Mootools Paginator
/**
* Paginating through elements with MooTools
*
* Use:
* new ThinklePaginator(el, options);
*
* @link www.needathinkle.com/tumblr/18254885740
* @version 2
* @author Ashley White, www.needathinkle.com
* @license @license http://creativecommons.org/licenses/by-sa/3.0/
@ziadoz
ziadoz / awesome-php.md
Last active February 3, 2025 20:55
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@garyharan
garyharan / _mixins.scss
Created May 5, 2011 15:46
Useful scss mixins (rounded corners, gradients, text-field, button)
@mixin box-shadow($top, $left, $blur, $color, $inset: false) {
@if $inset {
-webkit-box-shadow:inset $top $left $blur $color;
-moz-box-shadow:inset $top $left $blur $color;
box-shadow:inset $top $left $blur $color;
} @else {
-webkit-box-shadow: $top $left $blur $color;
-moz-box-shadow: $top $left $blur $color;
box-shadow: $top $left $blur $color;
}