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 | |
/** | |
* Objects of this class are superficially similar to JavaScript objects | |
* in that you can dynamically add and overwrite both properties and methods | |
* the resemblance is not very strong, though. | |
*/ | |
// Note, there are a few ways to pass functions around | |
// in arrays is one | |
// $F = array(); | |
// |
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 | |
/** | |
* Objects of this class are superficially similar to JavaScript objects. | |
While you can never have quite the simplicity of the object literal in PHP | |
you can get pretty close. We're going to duplicate these two variations in | |
PHP as closely as we can. |
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
/** | |
* Utility to add a className to the menu block menu item that would be the | |
* current node's parent, based on the url path. | |
* @param {array} cores, an array containing the 1st parts of url segments | |
* associated with individual menu blocks where the | |
* index maps to the id of the menu block such that | |
* for a[n] there will exist an element with the id | |
* block-menu_block-n. | |
* @author Noah Feldman | |
* @copyright 2011 |
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
/** see https://gist.github.com/1066357 for full explanation | |
* This is mozilla only and was written to be used in conjunction with a greasemonkey script | |
* the many '!important' are only because I couldn't be sure how specific competing selectors | |
* were going to be. | |
*/ | |
body { position: relative !important} | |
#container { padding-top: 20px !important } | |
#admin-menu { margin-top: 0 !important; top: 0 !important} |
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
// ==UserScript== | |
// @name Front End Editor | |
// @namespace NSF | |
// @include http://the.devsite.com/* | |
// ==/UserScript== | |
/** | |
* @copyright 2011 Noah Feldman all rights reserved | |
* @author Noah Feldman | |
* @depends a good browser |
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 2011 all rights reserved | |
* @author Noah Feldman | |
* This was originally written as a greasemonkey script and used to demonstrate to a vendor | |
* that the markup they'd delivered was worse than inadequate. In addition to being | |
* so inconsistent that their efforts to style it consistently resulted in bloated, | |
* unwieldy CSS, they'd also made it impossible to have any confidence in programatic | |
* manipulation of the documents returned. This file, coupled with a custom stylesheet | |
* <https://gist.github.com/gists/1066284> made the majority of issues painfully obvious. | |
* This is far from perfect, but it served its purpose and is useful enough that I |
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
/** | |
* A quick and dirty function to apply a className to a custom html snippet | |
* in the Wibiya toolbar in browsers that do not support media queries, w/out | |
* bothering to learn the Wibiya API. Include before the closing </body> tag. | |
* | |
* Was written specifically to provide IE support for the following snippet | |
* of html and css: | |
*/ | |
// <style type="text/css"> | |
// @media screen and (max-width: 740px) {#wibiyaToolbar_support_key span { display:none; padding-left:60px;padding-right: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
/** | |
* For the day job, pay it no mind | |
*/ | |
(function () { | |
if (document.getElementById('quicktabs-5')) { | |
var faculty = $('.faculty-name'), | |
rootBlock = $('#block-block-12'), | |
nameOuter = rootBlock.find('> div > div').eq(0), | |
letters = {}, alpha = '', listItems = '', node, |
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
/** | |
* ************************************************ | |
* Rosetta Code: Four-Bit Adder Simulation | |
* http://rosettacode.org/wiki/Four_bit_adder | |
* ************************************************ | |
* The aim of this task is to "simulate" a four-bit adder "chip". This "chip" | |
* can be realized using four 1-bit full adders. Each of these 1-bit full | |
* adders can be with two half adders and an or gate. Finally a half adder can | |
* be made using a xor gate and an and gate. The xor gate can be made using two | |
* nots, two ands and one or. |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<!--[if IE]><![endif]--> <!-- workaround for: phpied.com/conditional-comments-block-downloads/ --> | |
<title>UNTITLED</title> | |
<meta charset="utf-8"> | |
<script>(function(a,c){var b=' ' + a[c] + ' ';a[c]?(b.indexOf('js') > -1 ||(a[c]+=' js'),b.indexOf('jsOff') > -1 ||(a[c]+=' jsOff')):a[c]="js jsOff",setTimeout(function(){a[c]=a[c].replace(/\s*?jsOff\s?/,'')},3e3)}(document.documentElement, 'className'))</script> | |
<meta name="author" content="Noah Feldman"> |
OlderNewer