Skip to content

Instantly share code, notes, and snippets.

try { destroy_F494196919266RMLQOC(); } catch (e) {}
jQuery('#'+"F494196919266RMLQOC").html("<div class=\"base-create-item create-item-units\">\u000a <h3>Units</h3>\u000a <div class=\"row-fluid\">\u000a <div class=\"span12 \">\u000a <div class=\"span4\">\u000a <span><strong>Qty on Hand:</strong></span>\u000a </div>\u000a <span class=\"text options\" id=\"qty\">99</span>\u000a </div>\u000a </div>\u000a \u000a <div class=\"row-fluid\">\u000a <div class=\"span12 \">\u000a <div class=\"span4\">\u000a <span><strong>Cost:</strong></span>\u000a </div>\u000a <div>\u000a <span>$</span><span class=\"text options\" id=\"cost\">0.00</span>\u000a </div>\u000a </div>\u000a </div>\u000a <div class=\"row-fluid\">\u000a <div class=\"span12 \">\u000a <div class=\"span4\">\u000a <span><strong>Reg
const html9 = (`<html><head></head><body><div data-lift="ReplaceInnerSpan"><p>Diego</p><p class="last-name">Bauman</p></div></body></html>`)
func ReplaceInnerSpan(in string) string {
//in is the html we get from the template
sq, _ := selector.Selector("[data-lift]")
//because the html may not be a full page, we use the Partial* function
node, _ := h5.PartialFromString(in)
for _, value1 := range node {
//apply the css selector to get a []*html.Node of matching nodes
object OnDiskFileParamHolder {
def apply(n: String, mt: String, fn: String, inputStream: InputStream): OnDiskFileParamHolder =
{
val file: File = File.createTempFile("lift_mime", "upload")
val fos = new FileOutputStream(file)
val ba = new Array[Byte](8192)
def doUpload() {
inputStream.read(ba) match {
case x if x < 0 =>
case 0 => doUpload()
@fmpwizard
fmpwizard / Boot.scala
Created June 10, 2014 18:47
Bootstrap Lift messages / notices
val jsNotice =
"""$('#lift__noticesContainer___notice li')
|.addClass("alert alert-success")
|.append('<button type="button" class="close" data-dismiss="alert">×</button>')""".stripMargin
val jsWarning =
"""$('#lift__noticesContainer___warning li')
|.addClass("alert")
|.append('<button type="button" class="close" data-dismiss="alert">×</button>')""".stripMargin
@fmpwizard
fmpwizard / rover.ino
Last active August 29, 2015 14:01
Control a rover using an arduino
// Adafruit Motor shield library
// copyright Adafruit Industries LLC, 2009
// this code is public domain, enjoy!
#include <AFMotor.h>
// DC motor on M1, Left wheel
AF_DCMotor left(1);
// DC motor on M2, Right wheel
AF_DCMotor right(2);
diego@diego-HP-EliteBook-8460p:~/work/lift/helping/LiftQuestionAjaxCheckbox$ git diff
diff --git a/project/plugins.sbt b/project/plugins.sbt
index 3f5d4d0..1d291b1 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -1,4 +1,5 @@
-addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.9.0")
+addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.5.0")
+
@fmpwizard
fmpwizard / time-lapse.sh
Created April 15, 2014 02:51
Taking Time lapse pictures using the raspberry pi camera and sending the images to a local server/laptop
#!/bin/bash
let X=1;
while true; do
ssh -p 2200 pi@fmpwizard.no-ip.org raspistill -rot 90 -w 1024 -h 768 -o $X.jpg &&
scp -oPORT=2200 pi@fmpwizard.no-ip.org:$X.jpg . ;
ssh -p 2200 pi@fmpwizard.no-ip.org rm $X.jpg
X=$((X+1));
sleep 1;
done
@fmpwizard
fmpwizard / time-lapse.sh
Created November 12, 2013 01:30
Take pictures on the Raspberry Pi once a second and store them on a uuid named folder This runs at boot time using @reboot on cron
#!/bin/bash
let X=1;
folder=`/usr/bin/dbus-uuidgen`
cd /home/pi/camera/trip
mkdir $folder
cd $folder
while true; do
raspistill -rot 90 -w 1024 -h 768 -o $X.jpg
sync
echo "Image: $X.jpg";
import sbt._
import sbt.Keys._
object MyBuild extends Build {
import Dependencies._
import BuildSettings._
lazy val main = Project("root", file("."))
.settings(mainWebSettings: _*)
.settings(
sysadmins-MacBook-Pro-8:Desktop diego.medina$ wget http://repo.cloudbees.com/content/groups/public/net/liftweb/lift-webkit_2.9.1/2.5/lift-webkit_2.9.1-2.5.jar
--2013-08-07 22:26:43-- http://repo.cloudbees.com/content/groups/public/net/liftweb/lift-webkit_2.9.1/2.5/lift-webkit_2.9.1-2.5.jar
Resolving repo.cloudbees.com... 184.73.168.54
Connecting to repo.cloudbees.com|184.73.168.54|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5883511 (5.6M) [application/java-archive]
Saving to: ‘lift-webkit_2.9.1-2.5.jar’
100%[==================================================================================================================================================================================================>] 5,883,511 1.10MB/s in 5.0s