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
UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://www.old-domain.com', 'http://www.new-domain.com'); |
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
// | |
// AngleGradientBorderTutorial-Bridging-Header.h | |
// AngleGradientBorderTutorial | |
// | |
#import "AngleGradientLayer.h" |
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
// | |
// AngleGradientBorderLayer.swift | |
// AngleGradientBorderTutorial | |
// | |
import UIKit | |
class AngleGradientBorderLayer: AngleGradientLayer { | |
// Properties |
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
// | |
// AngleGradientBorderView.swift | |
// AngleGradientBorderTutorial | |
// | |
import UIKit | |
class AngleGradientBorderView: UIView { | |
// Constants |
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
var fitTextToWidth = function(node, width) { | |
var nodeWidth = node.getBBox().width; | |
if (nodeWidth > width) { | |
var $node = $(node); | |
var fontSize = $node.css('font-size'); | |
fontSize = parseInt(fontSize.substring(0, fontSize.length - 2)); | |
fontSize--; | |
if (fontSize > 0) { | |
$node.css('font-size', fontSize + 'px'); | |
fitTextToWidth(node, width); |
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 LinkedListNode | |
attr_accessor :value, :next_node | |
def initialize(value, next_node=nil) | |
@value = value | |
@next_node = next_node | |
end | |
end | |
def reverse_list(list, previous=nil) |
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
# Template when looking at a recursive function: | |
# | |
# If base case, then end recursion | |
# else reducation case, and call recursively | |
# Example: Adding together all the elements of an array. | |
def sum(numbers_array) | |
# Base Case: Is the array empty? | |
if numbers_array.empty? | |
return 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
public class Singleton<T>: MonoBehaviour where T: MonoBehaviour { | |
protected static T instance; | |
// Returns the instance of this singleton. | |
public static T Instance { | |
get { | |
if (instance == null) { | |
instance = (T)FindObjectOfType(typeof(T)); | |
if (instance == null) { |
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 ViewController: UIViewController { | |
// The magic enum to end our pain and suffering! | |
// For the most part the order of our cases do not matter. | |
// What is important is that our first case is set to 0, and that our last case is always `total`. | |
enum TableSection: Int { | |
case action = 0, comedy, drama, indie, total | |
} | |
// This is the size of our header sections that we will use later on. |
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
let MovieData = [ | |
["title": "Jason Bourne", "cast": "Matt Damon, Alicia Vikander, Julia Stiles", "genre": "action"], | |
["title": "Suicide Squad", "cast": "Margot Robbie, Jared Leto, Will Smith", "genre": "action"], | |
["title": "Star Trek Beyond", "cast": "Chris Pine, Zachary Quinto, Zoe Saldana", "genre": "action"], | |
["title": "Deadpool", "cast": "Ryan Reynolds, Morena Baccarin, Gina Carano", "genre": "action"], | |
["title": "London Has Fallen", "cast": "Gerard Butler, Aaron Eckhart, Morgan Freeman, Angela Bassett", "genre": "action"], | |
["title": "Ghostbusters", "cast": "Kate McKinnon, Leslie Jones, Melissa McCarthy, Kristen Wiig", "genre": "comedy"], | |
["title": "Central Intelligence", "cast": "Dwayne Johnson, Kevin Hart", "genre": "comedy"], | |
["title": "Bad Moms", "cast": "Mila Kunis, Kristen Bell, Kathryn Hahn, Christina Applegate", "genre": "comedy"], | |
["title": "Keanu", "cast": "Jordan Peele, Keegan-Michael Key", "genre": "comedy"], |
OlderNewer