Skip to content

Instantly share code, notes, and snippets.

@sixman9
sixman9 / install.sh
Last active August 29, 2015 14:17 — forked from hauleth/install.sh
#!/bin/bash
# Add repositories
sudo add-apt-repository -y "deb http://repository.spotify.com stable non-free"
sudo add-apt-repository -y ppa:webupd8team/java
sudo add-apt-repository -y ppa:fish-shell/nightly-master
echo "deb http://downloads.hipchat.com/linux/apt stable main" | sudo tee \
/etc/apt/sources.list.d/atlassian-hipchat.list
sudo add-apt-repository -y ppa:linrunner/tlp
sudo apt-add-repository -y ppa:pipelight/stable
package object mail {
implicit def stringToSeq(single: String): Seq[String] = Seq(single)
implicit def liftToOption[T](t: T): Option[T] = Some(t)
sealed abstract class MailType
case object Plain extends MailType
case object Rich extends MailType
case object MultiPart extends MailType

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
@sixman9
sixman9 / build.gradle
Last active March 22, 2018 16:36
My base Gradle build file, with sample Intellij & Eclipse project config section - This a version of https://github.com/sixman9/gradleExample/blob/master/build.gradle.
version = 0.1
apply plugin: 'java'
//apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin:'application' //See 'mainClassName', issue 'gradle run'
mainClassName = "YourMainClassNameHere"
#!/bin/bash
function _usage() {
cat <<USAGE
usage: $(basename $0) PATTERN [FILES]
Print the HTML that matches the CSS selector PATTERN.
USAGE
}
@sixman9
sixman9 / howDraqDropCodeFragmentInMQuick.lua
Created January 15, 2013 14:33
How to drag and drop in Marmalade Quick (Lua), code fragment (incomplete)
--https://devnet.madewithmarmalade.com/questions/3537/drag-and-drop-marmalade-quick.html
local box = director:createRectangle(director.displayCenterX, director.displayCenterY, 100, 100)
box.color = color.green
function box:touch(event)
if event.phase == "began" then
self.color = color.red
box.xLast = event.x
box.yLast = event.y
@sixman9
sixman9 / QPhysics-PreFeb2013-patch.cpp
Last active December 11, 2015 03:38
Pre-February 2013 Marmalade Quick Box2d physics CPP "patch"
//See https://devnet.madewithmarmalade.com/questions/3701/kinematic-bodies-in-marmalade-quick.html
//Basically in QPhysics.cpp, the NodeProps::sync() function needs to be as follows:
if (!m_Body)
return;
// Box2D stuff
if (m_IsSensor == false) // sensor object transforms aren't dictated by the simulation
{
// Body dictates transform
@sixman9
sixman9 / main.lua
Created January 15, 2013 14:27
"Marmalade Quick" lua-based simple Ping Pong game
--[[
Provided by Tim Closs see https://devnet.madewithmarmalade.com/questions/3701/kinematic-bodies-in-marmalade-quick.html
Ping pong game.
Drag the bats up and down, and attempt to keep the ball in play.
The bats and ball are physics "sensor" objects, so generate collision
events but no physical responses.
--]]
local dw = director.displayWidth
@sixman9
sixman9 / installKivySrc.sh
Last active June 25, 2019 08:38
Installs the latest Kivy source distribution from Github for Debian/Ubuntu
#!/bin/bash
kivyBaseBuildDir=/tmp
myKivyInstallAlias="kivyDev"
#Build and install Kivy on Ubuntu - http://kivy.org/docs/installation/installation.html#development-version
#Modify the PYTHONPATH to point at our Kivy install - see http://docs.python.org/2/tutorial/modules.html#the-module-search-path AND http://docs.python.org/2/tutorial/modules.html#standard-modules
sudo apt-get install python-setuptools python-pygame python-opengl python-gst0.10 python-enchant gstreamer0.10-plugins-good python-dev build-essential libgl1-mesa-dev libgles2-mesa-dev python-pip
if [ ! `pip freeze | grep -i cython` ]; then
@sixman9
sixman9 / moaiLinuxUnoffical.sh
Created November 28, 2012 17:08
Build Unofficial Moai Lua game development on Linux
#!/bin/bash
#moaiLinuxUnoffical.sh
#Determine the OS architecture (32/64bit) using 'uname -m', then run the required commands (see http://stackoverflow.com/a/106416/304330)
ourArch=$(uname -m)
#Linux-friendly version of Moai
#see also git://github.com/shadowmint/moai-dev.git
githubRepoOwner="spacepluk"