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
<?php | |
//Force SSL so that passwords aren't sent in the clear. | |
if($_SERVER["HTTPS"] != "on") { | |
header("HTTP/1.1 301 Moved Permanently"); | |
header("Location: https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]); | |
exit(); | |
} | |
//Here's where the Wordpress magic happens. |
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
#!/bin/bash | |
# Takes one parameter: a remote git repository URL. | |
# | |
# This is the stuff this script does: | |
# | |
# 1. Clones the repository | |
# 2. Fetches all remote branches | |
# 3. Compresses the folder | |
# 4. Deletes the cloned folder. |
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
#!/usr/bin/env ruby | |
# fix-xcode | |
# Mark Rickert <mjar81@gmail.com> | |
# Symlinks all your old SDKs to Xcode.app every time it is updated. | |
# Create a directory called /SDKs and run this script. | |
# | |
# Each time you upgrade Xcode, run fix-xcode. |
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
/* | |
* Example implementation | |
*/ | |
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation | |
{ | |
NSLog(@"Launched with URL: %@", url.absoluteString); | |
NSDictionary *userDict = [self urlPathToDictionary:url.absoluteString]; | |
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 the crucial options | |
UPDATE wp_options | |
SET option_value = 'http://newdomain.com' | |
WHERE option_name in ('siteurl', 'home'); | |
#Make sure search engines can access the deployed site | |
UPDATE wp_options | |
SET option_value = 1 | |
WHERE option_name = 'blog_public'; | |
#Set the GUIDs to have the correct domain | |
UPDATE wp_posts |
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
import React, { PropTypes } from 'react' | |
import {View, ListView, Text } from 'react-native' | |
export default class ScrollToBottomExample extends React.Component { | |
constructor (props) { | |
super(props) | |
// Set up our two placeholder values. | |
this.listHeight = 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
# wo = work on | |
wo() { | |
code_dir=~/Dropbox # replace it with your development directory | |
cd $(find $code_dir -type d -maxdepth 3 | grep -i $* | grep -Ev Pods --max-count=1) | |
} |
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 StatesScreen < PM::TableScreen | |
title "States" | |
def will_appear | |
view.backgroundView = nil | |
view.backgroundColor = UIColor.redColor | |
end | |
def table_style |
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 CreateStates < ActiveRecord::Migration | |
def change | |
create_table :states do |t| | |
t.string :name | |
t.string :abbrev | |
t.timestamps | |
end | |
end | |
end |
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
it "should select all cells and go back" do | |
wait 0.5 do #Wait for the view to load | |
ips = [] | |
(1..@screen.table_view.numberOfSections-1).to_a.each do |section| # (skip the first section) | |
rows = @screen.table_view.numberOfRowsInSection(section) | |
(0..rows-1).to_a.each do |row| | |
ips << NSIndexPath.indexPathForRow(row, inSection:section) | |
end |
NewerOlder