Skip to content

Instantly share code, notes, and snippets.

View WillSams's full-sized avatar
🚀

Will Sams WillSams

🚀
View GitHub Profile
import logging
import time
logger = logging.getLogger(__name__)
def useful():
logger.debug('Hello from webapplib!')
time.sleep(0.01)
@WillSams
WillSams / gist:4945386
Last active December 13, 2015 17:09
Custom validators for use with jquery validate
jQuery.validator.addMethod("dateGreaterThan", function (value, element, params) {
if (!/Invalid|NaN/.test(new Date(value))) {
return new Date(value) > new Date($(params).val());
}
return isNaN(value) && isNaN($(params).val())
|| (Number(value) > Number($(params).val()));
}, '<br />Must be greater than {0}.');
jQuery.validator.addMethod('greaterThan', function (value, element, param) {
@WillSams
WillSams / Dell-Inspiron-Ubuntu-Nvidia.txt
Last active March 20, 2016 10:13
Dell Inspiron Hybrid Graphics - getting NVIDIA card working
sudo apt-get remove nvidia* && sudo apt-get autoremove
This went well, no errors. Then I added a new file, /etc/modprobe.d/nouveau.conf
blacklist nouveau
blacklist lbm-nouveau
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
@WillSams
WillSams / Example Bottle.py App Running on Gandi.Net Simple Hosting Last
Last active April 21, 2016 12:19
Example Bottle.py App Running on Gandi.Net Simple Hosting Last
#git pull ssh+git://<login>@git.<datacenter>.gpaas.net/default.git
mkdir -p MyWebApp && cd MyWebApp
virtualenv venv
source venv/bin/activate
pip install bottle
pip freeze > requirements.txt
cat > hello.py <<EOF
# -*- coding: utf-8 -*-
@WillSams
WillSams / iso2wbfs
Created August 11, 2016 21:13 — forked from openback/iso2wbfs
Uses Wiimms ISO Tool to convert one or more Wii ISO into a WBFS file, properly named for use on non-WBFS partitions
#!/bin/bash
#===============================================================================
#
# FILE: iso2wbfs
#
# USAGE: ./iso2wbfs [option] FILE... [wbfs directory]
#
# DESCRIPTION: Uses wit to convert one or more Wii ISO into a WBFS file
# properly named for use on non-WBFS partitions.
#
#note, do wodim --devices to find the correct device
cdirip image.cdi -wodim
wodim dev=/dev/sg0 speed=8 -multi -audio taudio01.wav && rm taudio01.wav
wodim dev=/dev/sg0 speed=8 -multi -xa tdata02.iso && rm tdata02.iso
eject
sudo mount /dev/sda1 /mnt
for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done
sudo grub-install --root-directory=/mnt/ /dev/sda
sudo chroot /mnt
apt-get re-install 'linux-image-4.4*'
updateinitrams -u -k all
update-grub
exit
reboot
@WillSams
WillSams / clone_retropie_sd
Created August 28, 2016 12:29
Clonng RetroPie Install To Another SD Card
#Steps taken from http://bobbyromeo.com/technology/backup-clone-raspberry-pi-sd-card/
#On your RaspberryPI live system, do these steps. Have your target sd card unmounted
#in a SD card reader attached to one of the USB ports.
git clone https://github.com/billw2/rpi-clone.git
cd rpi-clone
cp rpi-clone /usr/local/sbin
sudo rpi-clone sdb -v -x
@WillSams
WillSams / netbeans_cplusplus_note
Created September 18, 2016 19:38
Netbeans C++ note
Projects with external data outside of the working directory will have probems (i.e., java.lang.nullexception) if you use the default external console. Go to Project properties -> Run -> Console Type and select Standard Output.
@WillSams
WillSams / pom.xml
Last active February 1, 2017 18:39
My Struts2 Development POM
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.stormgames.web</groupId>
<artifactId>web</artifactId>
<packaging>war</packaging>
<version>0.0.1</version>
<name>Struts2 Example</name>
<properties>