I like the jquery-circle-progress plugin but I wanted it to do circle timing because I didn't like any of the other circle timers out there.
Here is what I came up with:
<html>
<body>
| <?php | |
| $str = "String to loop through" | |
| $strlen = strlen( $str ); | |
| for( $i = 0; $i <= $strlen; $i++ ) { | |
| $char = substr( $str, $i, 1 ); | |
| // $char contains the current character, so do your processing here | |
| } | |
| ?> |
| func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String { | |
| let calendar = NSCalendar.currentCalendar() | |
| let unitFlags = NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitHour | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitSecond | |
| let now = NSDate() | |
| let earliest = now.earlierDate(date) | |
| let latest = (earliest == now) ? date : now | |
| let components:NSDateComponents = calendar.components(unitFlags, fromDate: earliest, toDate: latest, options: nil) | |
| if (components.year >= 2) { | |
| return "\(components.year) years ago" |
I like the jquery-circle-progress plugin but I wanted it to do circle timing because I didn't like any of the other circle timers out there.
Here is what I came up with:
<html>
<body>
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't
| // reference: https://github.com/pepelkod/iOS-Examples/blob/master/PlaySoundWithVolume/PlaySoundWithVolumeAction.m | |
| import SpriteKit | |
| public extension SKAction { | |
| public class func playSoundFileNamed(fileName: String, atVolume: Float, waitForCompletion: Bool) -> SKAction { | |
| let nameOnly = fileName.stringByDeletingPathExtension | |
| let fileExt = fileName.pathExtension | |
| <?php | |
| /** | |
| * Dirty, dirty Reddit bot: Decronym | |
| */ | |
| class Reddit { | |
| const USERNAME = 'Decronym'; | |
| const PASSWORD = '***'; | |
| const CLIENTID = '***'; | |
| const SECRET = '***'; |
| <?php | |
| // Converts a number into a short version, eg: 1000 -> 1k | |
| // Based on: http://stackoverflow.com/a/4371114 | |
| function number_format_short( $n, $precision = 1 ) { | |
| if ($n < 900) { | |
| // 0 - 900 | |
| $n_format = number_format($n, $precision); | |
| $suffix = ''; | |
| } else if ($n < 900000) { |