This file contains 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 | |
/*! | |
* Class db | |
* (c) Stephen Middleton 2010 | |
* Liscensed under the MIT Liscense | |
* <http://www.opensource.org/licenses/mit-license.html> | |
* Provides a Filesystem JSON-store to store information in a document Fashion | |
* See <http://www.json.org> for more information on the JSON format. | |
* | |
* Usage:: |
This file contains 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
/*! | |
* $.expressions | |
* (c) Stephen Middleton 2010 | |
* Licensed under the MIT license | |
* <http://www.opensource.org/licenses/mit-license.html> | |
* Makes an easier modifying method to add Psuedo Expressions | |
* Syntax:: | |
* //no variables | |
* $.expressions("hasText", function(ArgumentsArray, LocationInList, List){ | |
* //if returns true, it will be in the list, otherwise it's be filtered out |
This file contains 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
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
This file contains 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
/** | |
* -------------------------------------------------------------------- | |
* jQuery-Plugin "pngFix" | |
* Version: 1.2, 09.03.2009 | |
* by Andreas Eberhard, andreas.eberhard@gmail.com | |
* http://jquery.andreaseberhard.de/ | |
* | |
* Copyright (c) 2007 Andreas Eberhard | |
* Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php) | |
* |
This file contains 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
(function($){ | |
var cache, defaults; | |
cache = {}; | |
defaults = { | |
//ajax information | |
'url': "", | |
'method': "GET", |
This file contains 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
/* | |
Copyright 2010 Stephen "Rixius" Middleton | |
Licensed under the MIT-style License <http://www.opensource.org/licenses/mit-license.html> | |
usage Style(Object styleRules, object Options) | |
Options: { //with defaults | |
makeStyle: true, //if true makes the <style> elment and wraps it around the styles | |
placeInDOM: false, //if true, if makeStyle is true, then places the elemen ad the of the <head> element | |
important: false //appends " !important" at the end of each declration, Just in case it's needed; |
This file contains 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 Interval = (function (und){ | |
return function(fn, time, count){ | |
if (time !== time-0) return null; | |
if (count !== count-0) count = -1; | |
switch (count){ | |
case -1: | |
return setInterval(fn, time); | |
break; | |
case 0: | |
return setTimeout(fn, time); |
This file contains 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
#!/usr/bin/env python | |
# coding=UTF-8 | |
import math, subprocess | |
p = subprocess.Popen(["ioreg", "-rc", "AppleSmartBattery"], stdout=subprocess.PIPE) | |
output = p.communicate()[0] | |
o_max = [l for l in output.splitlines() if 'MaxCapacity' in l][0] | |
o_cur = [l for l in output.splitlines() if 'CurrentCapacity' in l][0] |
This file contains 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
Copyright (c) 2011 YOUR_NAME_HERE, YOUR_URL_HERE | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: | |
This file contains 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
Copyright (c) 2011 Jed Schmidt, http://jed.is | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to | |
permit persons to whom the Software is furnished to do so, subject to | |
the following conditions: | |