Skip to content

Instantly share code, notes, and snippets.

@Inferis
Inferis / UIColor+Hex.h
Created January 13, 2011 23:24
Hex + CSS extensions to create UIColors from hex colour values or CSS colour strings.
//
// UIColor+Hex.h
//
// Created by Tom Adriaenssen on 13/01/11.
//
@interface UIColor (Hex)
+ (UIColor*) colorWithCSS: (NSString*) css;
+ (UIColor*) colorWithHex: (NSUInteger) hex;
@Jaybles
Jaybles / UIDeviceHardware.h
Created October 28, 2011 19:33
UIDeviceHardware - Determine iOS device being used
//
// UIDeviceHardware.h
//
// Used to determine EXACT version of device software is running on.
#import <Foundation/Foundation.h>
@interface UIDeviceHardware : NSObject
- (NSString *) platform;
@luetkemj
luetkemj / wp-query-ref.php
Last active May 25, 2024 10:56
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@zypsg
zypsg / uiunderlinebutton.h
Created March 27, 2012 09:52
iOS: Underline the title of a UIButton
@interface UIUnderlinedButton : UIButton
+ (UIUnderlinedButton*) underlinedButton;
@end
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
@stereobooster
stereobooster / readme.md
Created June 19, 2012 06:31
Underscore string descending sortBy
/**
* Underscore string descending sortBy
* usage:
* Sort by name ascending `_.sortBy(data, string_comparator('name'));`
* Sort by name descending `_.sortBy(data, string_comparator('-name'));`
*/
var string_comparator = function(param_name, compare_depth) {
if (param_name[0] == '-') {
param_name = param_name.slice(1),
compare_depth = compare_depth || 10;
@r-sal
r-sal / PHPExcel_Basics.md
Last active May 8, 2024 06:29
PHPExcel Notes and code snippets

Basics

Creating a new PHPExcel Object.

    $this->PHPExcel = new PHPExcel();

Working with sheets

Creating a new sheet:

@nicolas-brousse
nicolas-brousse / 0_menu.md
Last active December 10, 2015 23:39
Tips for a fresh install on Ubuntu server
@ammulder
ammulder / camera.html
Created March 8, 2013 21:39
Web page with JS camera and image manipulations
<!DOCTYPE html>
<head>
<title>HTML5 Camera Fun</title>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="http://www.nihilogic.dk/labs/exif/exif.js" type="text/javascript"></script>
<script src="http://www.nihilogic.dk/labs/binaryajax/binaryajax.js" type="text/javascript"></script>
<script type="text/javascript">
// Wrapper around MPL-licensed http://www.nihilogic.dk/labs/binaryajax/binaryajax.js
// to support JavaScript typed arrays since binary strings are not supported in IE 10
var createBinaryFile = function(uintArray) {
@stongo
stongo / app.js
Last active June 13, 2024 11:40
Joi validation in a Mongoose model
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');
var db = mongoose.connection;
db.on('error', function() {
return console.error.bind(console, 'connection error: ');
});