Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel O’Connor danoc

View GitHub Profile
@danoc
danoc / SketchSystems.spec
Last active Dec 3, 2019
Component development
View SketchSystems.spec
Component development
Needs evaluation
Will build -> To-do
Will use built-in platform component -> Uses built-in platform component
Is not applicable to platform -> Wont build for platform
Is not worth building -> Wont build for platform
Is already built correctly -> Merged
Is built but should be deprecated -> Deprecated
To-do
Start development -> In progress
@danoc
danoc / SassMeister-input.scss
Created Jul 18, 2015
Generated by SassMeister.com.
View SassMeister-input.scss
// ----
// Sass (v3.4.14)
// Compass (v1.0.3)
// ----
$list-tree-chain-base: '.list-tree__list';
$list-tree-chain: '';
$list-tree-chain-tail: '.list-tree__item';
$max-supported-tree-depth: 30;
View keybase.md

Keybase proof

I hereby claim:

  • I am danoc on github.
  • I am danoc (https://keybase.io/danoc) on keybase.
  • I have a public key whose fingerprint is CFF0 9260 DAA0 440E 656C 1555 9433 DFB5 21C4 DFBE

To claim this, I am signing this object:

@danoc
danoc / time_since.php
Created May 19, 2013
A function that returns a "human-readable" time such as 8 hours ago or 1 month ago.
View time_since.php
<?php
/**
* Return a "human-readable" time such as 8 hours ago.
*
* @param string $time such as: 2013-03-18 21:13:59
*/
function time_since($time)
{
View get_custom_excerpt
<?php
function get_custom_excerpt($text, $length)
{
$text = strip_shortcodes( $text );
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]&gt;', $text);
$text = strip_tags($text);
$excerpt_length = apply_filters('excerpt_length', $length);
@danoc
danoc / Current Temperature
Created Jan 16, 2012
Use SimpleXML and Google's (unofficial) Weather API to display the current temperature for a city.
View Current Temperature
<?php
// Use SimpleXML and Google's (unofficial) Weather API
//to display the current temperature for a city.
$zip = 13902; // change to desired city
$weather = simplexml_load_file('http://www.google.com/ig/api?weather='.$zip);
$city = $weather->weather->forecast_information->city['data']; // city name
$degrees = $weather->weather->current_conditions->temp_f['data']; // current temperature