This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Stopwatch: ObservableObject { | |
@Published private var progressTime = 58 | |
var hours: String { | |
let time = progressTime / 3600 | |
return time < 10 ? "0\(time)" : "\(time)" | |
} | |
var minutes: String { | |
let time = (progressTime % 3600) / 60 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) handleRequest | |
{ | |
// Wait up to five seconds for the network to be worth trying. | |
for (int i = 0; i < 5; i++) | |
{ | |
if (NetworkWorthTrying()) return; | |
[NSThread sleepForTimeInterval:1.0]; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rakefiles are a great way to automate your life | |
# | |
# Below are some example tasks I use each day in my | |
# iOS development. | |
# | |
# Do not get caught up in the missing implementation, but | |
# just take in the simplicity of each task as a time saving element. | |
# | |
# Let me know what you think via @strickland on Twitter. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<script>var __pbpa = true;</script><script>var translated_warning_string = 'Warning: Never enter your Tumblr password unless \u201chttps://www.tumblr.com/login\u201d\x0ais the address in your web browser.\x0a\x0aYou should also see a green \u201cTumblr, Inc.\u201d identification in the address bar.\x0a\x0aSpammers and other bad guys use fake forms to steal passwords.\x0a\x0aTumblr will never ask you to log in from a user\u2019s blog.\x0a\x0aAre you absolutely sure you want to continue?';</script><script type="text/javascript" language="javascript" src="http://assets.tumblr.com/assets/scripts/pre_tumblelog.js?_v=0fe6931f685c5a29060675a836044a62"></script> | |
<!doctype html> | |
<html> | |
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# blog: http://ogp.me/ns/blog#"> | |
<meta charset="utf-8"> | |
<!-- Always force latest IE rendering engine or request Chrome Frame --> | |
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible"> | |
<!-- Use title if it's in the page YAML frontmat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
# This importer takes a wordpress.xml file, which can be exported from your | |
# wordpress.com blog (/wp-admin/export.php). | |
require 'jekyll-import' | |
module JekyllImport | |
module Importers | |
class CustomWordpress < Importer | |
def self.require_deps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'aws-sdk' | |
require 'hub' | |
###################### | |
#### CONFIG STUFF #### | |
###################### | |
desc 'Update Config Files' | |
task :config do | |
puts 'Updating config files...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source 'http://rubygems.org' | |
# Make sure you have bundler installed | |
# gem install bundler | |
gem 'shenzhen' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Localized versions of Info.plist keys French */ | |
"Credits" = "Crédits"; | |
"Here are some great libraries I used to create this application:" = "Here are some great libraries I used to create this application:"; | |
"About" = "À propos"; | |
"Thank You" = "Remerciements"; | |
"Thank you to the amazing team at GitHub for creating a great product, without their hard work, none of this would have been possible." = "Merci à l'équipe extraordinaire à GitHub pour créer un excellent produit, sans leur travail acharné, rien de tout cela n'aurait été possible."; | |
"About the Developer" = "À propos du Développeur"; | |
"Icon Design" = "Icon Design"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
XML_FILE_LOCATION = 'path/to/my/xml/file.xml' | |
XML_XPATH = '//ANode' | |
XML_ATTR_FOR_IMAGE_NAME = 'imagename' | |
XML_ATTR_FOR_IMAGE_URL = 'imageurl' | |
file = File.open(XML_FILE_LOCATION, "rb") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def revBuild(plistFile) | |
puts "Attempting to update #{plistFile} build version..." | |
oldVersion = `/usr/libexec/PlistBuddy -c "Print CFBundleVersion" #{plistFile}` | |
puts "The old version: #{oldVersion}" | |
versionParts = oldVersion.split(".") | |
previousDate = versionParts[2] | |
newDate = Time.now.strftime("%Y%m%d") | |
versionParts[2] = newDate |
NewerOlder