Skip to content

Instantly share code, notes, and snippets.

View haleyngonadi's full-sized avatar

haley. haleyngonadi

  • Canada
View GitHub Profile
@lorenzo
lorenzo / file.ctp
Last active October 29, 2015 08:09
<?php
$this->Html->link($artist->name, ['action' => 'view', $artis->id, 'name' => $artist->name]);
@andkon
andkon / Custom cell with UITextField
Last active August 24, 2016 15:23
Custom cell with UITextField - for use with storyboards
Storyboard configuration:
1. Make a cell.
2. Give it a custom class of YourCell
3. Drag a label onto the cell, give the label a tag of 100. Configure and arrange as necessary.
4. Drag a text field onto the cell, give the textField a tag of 101. Configure and arrange as necessary.
@ivanbruel
ivanbruel / UIImage+UIColor
Created September 29, 2015 18:14
Animate crossfade UIColor and UIImage with SDWebImage
//
// UIImage+UIColor.swift
//
import UIKit
extension UIImage {
class func imageWithColor(color: UIColor) -> UIImage {
let rect = CGRectMake(0.0, 0.0, 1.0, 1.0)
UIGraphicsBeginImageContext(rect.size)
@leighmcculloch
leighmcculloch / NSString_stripHtml.h
Last active February 21, 2018 22:45
NSString + Strip HTML
// NSString_stripHtml.h
// Copyright 2011 Leigh McCulloch. Released under the MIT license.
#import <Foundation/Foundation.h>
@interface NSString (stripHtml)
- (NSString*)stripHtml;
@end
@ctcherry
ctcherry / iOSclass
Created February 1, 2012 18:28 — forked from KruegerDesigns/ios.html.class.js
Add mobile class to html tag for mobile devices along with the mobile type if known
// adds mobile class, and mobile os to html tag
jQuery(document).ready(function($){
var deviceAgent = navigator.userAgent.toLowerCase();
if (deviceAgent.match(/(iphone|ipod|ipad)/)) {
$('html').addClass('ios');
$('html').addClass('mobile');
}
if (deviceAgent.match(/android/)) {
@Phonbopit
Phonbopit / AndroidManifest.xml
Last active March 6, 2019 07:55
Android GSON with Custom ListView Tutorial , Article Link: http://devahoy.com/2014/05/android-custom-listview-with-gson-tutorial/
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.devahoy.sample.ahoygson" >
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
@harrypujols
harrypujols / WordPress Theme Customizer Sample.php
Created September 17, 2012 06:50 — forked from Abban/WordPress Theme Customizer Sample.php
WordPress Theme Customizer Sample
<?php
function themename_customize_register($wp_customize){
$wp_customize->add_section('themename_color_scheme', array(
'title' => __('Color Scheme', 'themename'),
'priority' => 120,
));
// =============================
@oguzhanaslan
oguzhanaslan / ResizingImageJquery.js
Last active February 23, 2020 08:08
Resizing image with jQuery
$(document).ready(function(){
$('.img-responsive').each(function() {
var maxWidth = 180; // Max width for the image
var maxHeight = 3000; // Max height for the image
var ratio = 0; // Used for aspect ratio
var width = $(this).width(); // Current image width
var height = $(this).height(); // Current image height
// Check if the current width is larger than the max
@ouelletv
ouelletv / socialSharePopups.js
Created August 1, 2018 13:58 — forked from josephabrahams/socialSharePopups.js
Facebook & Twitter Share Popup Windows
export default function() {
document.querySelectorAll('.js-share-facebook-link').forEach(function(el){
el.addEventListener('click', function(e){
var href = e.target.href;
e.preventDefault();
window.open(href, "Facebook", "toolbar=no,location=0,status=no,menubar=no,scrollbars=yes,width=600,height=400,resizable=1");
})
});
@devinsays
devinsays / combine-menus.php
Created November 13, 2015 18:09
Combines two WordPress menus into one.
<?php
/**
* Combines the markup of two menu areas into one.
*/
// Get the markup list items in the first menu.
$menu = wp_nav_menu( array(
'theme_location'=> 'menu-1',
'fallback_cb' => false,
'container' => '',