This file contains hidden or 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 parsing | |
import ( | |
"encoding/xml" | |
"io" | |
"log" | |
"reflect" | |
"code.google.com/p/go-charset/charset" | |
_ "code.google.com/p/go-charset/data" // |
This file contains hidden or 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
// Located in /controllers directory | |
package controller | |
func stuff(){} |
This file contains hidden or 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
# pecl install oci8 | |
downloading oci8-2.0.8.tgz ... | |
Starting to download oci8-2.0.8.tgz (190,854 bytes) | |
.........................................done: 190,854 bytes | |
11 source files, building | |
running: phpize | |
Configuring for: | |
PHP Api Version: 20131106 | |
Zend Module Api No: 20131226 | |
Zend Extension Api No: 220131226 |
This file contains hidden or 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 | |
/* | |
Template Name: UWM People Profile Directory | |
*/ | |
get_header(); | |
// Because WordPress is trying to be oh so helpful | |
remove_filter('the_content', 'wpautop'); |
This file contains hidden or 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 | |
list($titan, $options) = uwmpeople_get_plugin_options(); | |
// By default, let's try to get the profile photo. This may return an integer | |
// or a URL. Thanks WordPress. If profile photo is empty, then we set it to | |
// default image, which ALSO might be an integer or a URL. Hopefully this covers all cases. | |
$featured_image = $titan->getOption('profile_photo', $post_id); | |
if ( empty($featured_image) ) | |
$featured_image = $titan->getOption('default_image'); |
This file contains hidden or 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
# output from print as seen in my console. | |
[18/Aug/2014:21:41:00] HTTP Traceback (most recent call last): | |
File "/usr/local/lib/python3.4/dist-packages/cherrypy/_cprequest.py", line 670, in respond | |
response.body = self.handler() | |
File "/usr/local/lib/python3.4/dist-packages/cherrypy/lib/encoding.py", line 217, in __call__ | |
self.body = self.oldhandler(*args, **kwargs) | |
File "/usr/local/lib/python3.4/dist-packages/cherrypy/_cpdispatch.py", line 61, in __call__ | |
return self.callable(*self.args, **self.kwargs) | |
File "/home/mschuett/python/CherryBlog/CherryBlog/admin.py", line 49, in settings |
This file contains hidden or 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 sqlite3 | |
#python 3.4 | |
# This fails with key of site_title | |
db.execute("SELECT * FROM options WHERE key=?;", (key.encode('utf-8'),)) | |
# This works... | |
db.execute("SELECT * FROM options WHERE key='site_title';") | |
# This says I have supplied to many arguments... |
This file contains hidden or 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
// Run all tests and log to file | |
func RunTests(tests []testCase) { | |
color.Blue("Starting test casses...") | |
client := &http.Client{} | |
for _, test := range tests { | |
color.Blue("Test: " + test.Name) | |
color.Blue(test.Method + " " + test.Path) |
This file contains hidden or 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
type Handler struct { | |
pat string | |
http.Handler | |
} |
This file contains hidden or 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 //always use <?php because <? will be depricated in php 6.0 | |
// [defaultButton text="My Button"] | |
// This would display the bootstrap button with the text My Button inside it. | |
function bootstrapDefaultBTN( $atts ) { | |
extract( shortcode_atts( array( | |
'text' => 'Button', | |
), $atts ) ); | |