Skip to content

Instantly share code, notes, and snippets.

View brennanneoh's full-sized avatar

Brennan Neoh brennanneoh

View GitHub Profile
@brennanneoh
brennanneoh / README.md
Last active May 20, 2023 21:02
Anet A8 Printer Profile

Setup

  1. Install Cura 2.4
  2. Copy anet_a8.def.json to /Applications/Cura.app/Contents/Resources/resources/definitions
  3. Open Cura
  4. Expand Custom, then select Anet A8
  5. Click Finish
@brennanneoh
brennanneoh / about.md
Created December 26, 2016 09:25 — forked from danopia/about.md
Cards Against Humanity playing cards

Cards Against Humanity

Below are the white and black card sets published by Cards Against Humanity. Take them and come back with a bot. You have 48 hours, starting from an arbitrary time that I forget.

Black cards with 2 blanks are pick 2. Black cards with 3 blanks are pick 3, draw 2.

The rules are on the official web site.

These cards are taken from this PDF.

@brennanneoh
brennanneoh / gist:2157420
Created March 22, 2012 09:53
PHP Hands-On @ Hackerspace 22 March 2012
Login to AWS Management Console.
Start a Debian (x86) micro instance.
Access your instance via SSH.
Edit sources:
nano /etc/apt/sources.list
Copy:
@brennanneoh
brennanneoh / gist:1734470
Created February 4, 2012 02:13
sharepoint snippets
//obtaining reference to the current web (i.e. the web site which was defined when setting up the project in Visual Studio (in our case http://win7:8000/sites/QATP1PTS/)
objCurrentWeb = SPContext.Current.Web;
//Using SharePoint object model to retrieve both lists
objMembersList = objCurrentWeb.Lists["Project Members"];
objContactsList = objCurrentWeb.Lists["Project Contacts"];
//looping through the Members list
foreach (SPListItem objMembersListItem in objMembersList.Items)
{
@brennanneoh
brennanneoh / gist:1403250
Created November 29, 2011 03:28
setting up libssh2 + php ssh2 for xampp 1.7.3 (osx)
$ brew install -i libssh2
/* architecture tags are import. xampp 1.7.3 (osx) is x86. */
$ ./configure --prefix=/usr/local --disable-debug --disable-dependency-tracking --with-openssl --with-libz CFLAGS="-O -arch i386" CPPFLAGS="-O -arch i386" LDFLAGS="-arch i386"
$ make install
$ exit
/* assuming you have wget installed on osx */
@brennanneoh
brennanneoh / git-remove-history.sh
Created May 18, 2011 02:02
git-remove-history
#!/bin/bash
set -o errexit
# Author: David Underhill
# Script to permanently delete files/folders from your git repository. To use
# it, cd to your repository's root and then run the script with a list of paths
# you want to delete, e.g., git-remove-history path1 path2
if [ $# -eq 0 ]; then
exit 0
@brennanneoh
brennanneoh / nginx.conf
Created April 29, 2011 04:10
NGINX Configuration
#user http;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@brennanneoh
brennanneoh / xmlrpc_extend.py
Created April 28, 2011 05:51
Extension of Wordpress XMLRPC Python Library
from wordpress_xmlrpc.base import *
from wordpress_xmlrpc.mixins import *
from wordpress_xmlrpc.wordpress import WordPressBase, WordPressPost
class GetSport(AuthParamsOffsetMixin, AuthenticatedMethod):
method_name = 'metaWeblog.getPost'
method_args = ('post_id',)
results_class = WordPressPost
@brennanneoh
brennanneoh / weather.wsdl
Created April 28, 2011 04:50
WSDL File for Y! Weather Server
<?xml version='1.0' encoding='UTF-8' ?>
<definitions name='Weather'
targetNamespace='urn:Weather'
xmlns:tns='urn:Weather'
xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
xmlns:xsd='http://www.w3.org/2001/XMLSchema'
xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
xmlns='http://schemas.xmlsoap.org/wsdl/'>
@brennanneoh
brennanneoh / yahoo-weather-soap-server.php
Created April 28, 2011 04:45
Yahoo! Weather to SOAP
<?php
function getTownWoeid ($location_string) {
$woeid=null;
$yqlUrl = "http://query.yahooapis.com/v1/public/yql";
$query = "select woeid from geo.places where placeTypeName=\"Town\" and text=\"".$location_string."\"";
$queryUrl = $yqlUrl .
"?q=" . urlencode($query) .
"&format=xml";
$location_feed = file_get_contents($queryUrl);
$location = simplexml_load_string($location_feed);