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 | |
class DbConn | |
{ | |
private $db; // handle to connection | |
function __construct() | |
{ | |
global $db_host, $db_user, $db_pass, $db_name; | |
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
package com.joecheng.asyncshim.client; | |
import com.google.gwt.user.client.Command; | |
import com.google.inject.Inject; | |
import com.google.inject.Provider; | |
/** | |
* AsyncShim makes it easy to sequester a class behind GWT.runAsync() | |
* and cause it to be lazy-loaded, while still making it convenient to | |
* call (some types of) methods on it from other parts of the code that |
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/ruby | |
require 'pp' | |
# http://unicode.org/Public/UNIDATA/EastAsianWidth.txt | |
data = File.read('EastAsianWidth.txt') | |
data.gsub!(/\s*#.*/, '') | |
data = data.split | |
data.reject! {|x| x !~ /;/} | |
data = data.select {|x| x =~ /;[FW]/} |
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/ruby | |
require 'pp' | |
Invalid = 0 | |
NonAlpha = -1 | |
Alpha = 1 | |
NumericClasses = ['Nd'] | |
AlphaClasses = ['Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Nl'] |
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
== Sidebar | |
- Mailchimp sign up form [Joe] | |
== What's New | |
- Provide pictures and captions for slideshow [Natasha, Marc] | |
- Provide content for homepage posts [Natasha, Marc] | |
X Provide content for sidebar [Natasha] | |
- Sign up for newsletter | |
- Donate | |
- Click here for overview of Living Hope |
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
brew install rds-command-line-tools | |
rds-create-db-parameter-group mysql-utf8 -f mysql5.1 -d "MySQL 5.1 configured for UTF-8" | |
rds-modify-db-parameter-group mysql-utf8 \ | |
--parameters="name=character_set_server, value=utf8, method=immediate" \ | |
--parameters="name=character_set_client, value=utf8, method=immediate" \ | |
--parameters="name=character_set_results,value=utf8,method=immediate" \ | |
--parameters="name=collation_server, value=utf8_general_ci, method=immediate" \ | |
--parameters="name=collation_connection, value=utf8_general_ci, method=immediate" |
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
if (!sameElements(concat(ts1, ts2), new String[] {"Workspace", "History", "Files", "Plots", "Packages", "Help", "VCS", "PkgBuild"})) | |
{ | |
if (!sameElements(concat(ts1, ts2), new String[] {"Workspace", "History", "Files", "Plots", "Packages", "Help", "VCS"})) | |
{ | |
if (!sameElements(concat(ts1, ts2), new String[] {"Workspace", "History", "Files", "Plots", "Packages", "Help"})) | |
return false; | |
// It's only that the VCS tab is missing. Add it to tabset 1. | |
ts1.push("VCS"); | |
} |
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
library(shiny) | |
library(ggplot2) | |
function(input, output) { | |
dataset <- reactive({ | |
diamonds[sample(nrow(diamonds), input$sampleSize),] | |
}) | |
output$plot <- renderPlot({ |
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
library(shiny) | |
shinyServer(function(input, output) { | |
output$plot <- reactivePlot(function() { | |
plot(input$foo) | |
}) | |
}) |
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
library(shiny) | |
library(datasets) | |
library(ggplot2) | |
tg <- ToothGrowth | |
tg$dose <- factor(tg$dose) | |
# Define server logic | |
shinyServer(function(input, output) { | |
OlderNewer