Skip to content

Instantly share code, notes, and snippets.

🐢
🦄 🦄 🦄 🦄 🦄 🦄 🦄 🦄

Michael Schuett michaeljs1990

🐢
🦄 🦄 🦄 🦄 🦄 🦄 🦄 🦄
Block or report user

Report or block michaeljs1990

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View struct.go
type Handler struct {
pat string
http.Handler
}
@michaeljs1990
michaeljs1990 / unused.go
Created Aug 9, 2014
contentbody declared and not used.
View unused.go
// 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)
@michaeljs1990
michaeljs1990 / sqlite3.py
Last active Aug 29, 2015
Python Sqlite3
View sqlite3.py
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...
@michaeljs1990
michaeljs1990 / broken
Created Aug 19, 2014
sqlite3 oddness
View broken
# 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
View people.php
<?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');
View people_boilerplate.php
<?php
/*
Template Name: UWM People Profile Directory
*/
get_header();
// Because WordPress is trying to be oh so helpful
remove_filter('the_content', 'wpautop');
@michaeljs1990
michaeljs1990 / error.txt
Last active Aug 29, 2015
PECL OCI8 PHP56
View error.txt
# 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
View controller.go
// Located in /controllers directory
package controller
func stuff(){}
View help.go
package parsing
import (
"encoding/xml"
"io"
"log"
"reflect"
"code.google.com/p/go-charset/charset"
_ "code.google.com/p/go-charset/data" //
View gist:e8ed3520906df18ce6de
var socket = new WebSocket(r.thebutton._websocket._url);
socket.onmessage = function (event) {
payload = JSON.parse(event.data).payload;
console.log(payload.seconds_left);
if (payload.seconds_left == 1.0) {
document.getElementById('thebutton').click();
}
}
You can’t perform that action at this time.