This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
you need a cron job to grab the correct weather underground xml file. | |
here's what i use: | |
*/60 * * * * /usr/bin/curl -o /home/booyaa/public_html/boo/yaa/bay/surbiton.wunder.xml http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=ISURREYS1 >/dev/null 2>&1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# unix sysinfo 2 pachube eeml | |
# mark sta. ana (booyaa.org) | |
# assumptions: this script is running on a vps guest on openvz | |
# user connected | |
users=`w | head -1 | awk '{print $6}'` | |
# get home volume max storage capacity and current usage | |
homeFree=`df -m | grep '/dev/simfs' | awk '{print $4}'` | |
homeMax=`df -m | grep '/dev/simfs' | awk '{print $2}'` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// button to activate light | |
/* | |
* Purpose: Push button activates an LED that slow fades on and after a fixed paused, fades off. | |
* Change log: | |
* 20080202: initial release, calling this the first prototype. | |
* Code taken from: | |
* Button by DojoDave <http://www.0j0.org> - http://www.arduino.cc/en/Tutorial/Button | |
* Fading LED // by BARRAGAN <http://people.interaction-ivrea.it/h.barragan> | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ISO-8859-1" ?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<!-- this is useful for xml files like partial html code --> | |
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" /> | |
<!-- add the rest of your transformation here... --> | |
</xsl:stylesheet> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Handy XPages SSJS to help keep columns fixed width by truncating the content, but keeps the full | |
// text value as a tool tip using the ABBR tag. | |
// Still learning my way around XPages SSJS so any feedback is welcome | |
// Usage: 1) create a view variable callde "rowData" (All Props > Data > var) | |
// 2) set view column props to display as HTML | |
// 3) add code to data computed value: renderViewColumnDataAsTruncated("ProductDescription",15) | |
function renderViewColumnDataAsTruncated(columnName, maxLength) | |
{ | |
//FIXME: there must be a better way of handling viewScope variables... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: Helvetica, Verdana | |
} | |
p { | |
padding: 7px 10px; | |
} | |
#demo { | |
border: 1px solid #999; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11:16 < booyaa> anyone done markdown parsing? | |
11:16 < booyaa> i'm looking to read some github md files, ideally want to say... | |
11:16 < booyaa> md = parseMD('wiki-page.md') | |
11:17 < booyaa> tableAsObjectLiteral = md.table(0) | |
11:17 < booyaa> i fear i may need to write this myself. | |
11:17 < booyaa> everyone seems to be only intersted in parsing frmo md to html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Request = require('request'); | |
//doesn't work var Numbers = Numbers || {}; | |
var Numbers = function() { | |
// constructor | |
} | |
Numbers.prototype = { | |
baseUrl : 'http://numbersapi.com/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
IEnumerable<string> textFile = File.ReadLines(@"C:\leet\users.txt"); | |
var matches = from word in textFile | |
where word.Substring(0,2) == "FU" | |
select word; | |
matches.Dump(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pwd | |
/sys/class/leds | |
$ ls | |
led0 mmc0:: | |
$ ls -l | |
total 0 | |
lrwxrwxrwx 1 root root 0 Jan 1 1970 led0 -> ../../devices/platform/leds-gpio/leds/led0 | |
lrwxrwxrwx 1 root root 0 Jan 1 1970 mmc0:: -> ../../devices/platform/leds/mmc0:: |
OlderNewer