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
#!/usr/bin/env php | |
<?php while (1) { fputs(STDOUT, "\n\-PHP$ "); eval(trim(fgets(STDIN))); } ?> |
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
// requires jquery selector | |
$("a[href^=#]").click(function(e) { | |
var duration = $(this).data('scroll') || 750; | |
var target = $(this).attr('href'); | |
var $el = $(target); | |
if ($el.length || target == '#') { | |
e.preventDefault(); // prevent jumping to target or adding hash in url | |
// scroll to the element | |
$('html, body').animate({ | |
scrollTop: target == '#' ? 0 : $el.offset().top |
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
apache2ctl -t -D DUMP_MODULES |
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
/** | |
* Detects the font of an element from the font-family css attribute by comparing the font widths on the element | |
* @link http://stackoverflow.com/questions/15664759/jquery-how-to-get-assigned-font-to-element | |
*/ | |
(function($) { | |
$.fn.detectFont = function() { | |
var fontfamily = $(this).css('font-family'); | |
var fonts = fontfamily.split(','); | |
if ( fonts.length == 1 ) | |
return fonts[0]; |
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
/** | |
* JavaScript code to detect available availability of a | |
* particular font in a browser using JavaScript and CSS. | |
* | |
* Author : Lalit Patel | |
* Website: http://www.lalit.org/lab/javascript-css-font-detect/ | |
* License: Apache Software License 2.0 | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* Version: 0.15 (21 Sep 2009) | |
* Changed comparision font to default from sans-default-default, |
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
## Atom Cheatsheet. | |
#### Project Key Bindings. | |
- 'cmd-shift-p': open the command palette. | |
- 'cmd-p' or 'cmd-t': open the fuzzy finder to find a file. | |
- 'cmd-b': look for a file that is already open. | |
- 'cmd-shift-b': search the list of files modified and untracked in your project repository. | |
- 'ctrl-0': open and focus the the tree view. | |
- 'cmd-shift-f': find and replace in the entire project. |
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
#!/bin/bash | |
# inotifywait-cmd.sh | |
# | |
# Example: | |
# inotifywait-cmd.sh test/ 'phpunit --verbose test/ModelReferencesTest.php' | |
# | |
# Requires: https://github.com/thekid/inotify-win on windows | |
# | |
# author: Gabe LG <[email protected]> |
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 | |
/** | |
* @param Object $obj The Object to create an Id for | |
* @return String A human readable unique ID for the Object | |
* | |
* @internal Requires PHP5.2.0 | |
* @see http://php.net/manual/en/function.spl-object-hash.php | |
*/ | |
function get_obj_id($obj) |
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 | |
// usage | |
if(!isset($argv[1])){ | |
echo "\nUsage: ".$argv[0]." [options] iterations | |
Required: | |
iterations - Number of iterations of each test | |
Example: |
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 | |
/** | |
* Adds the given seconds to the subtitle file | |
* @author [email protected] | |
*/ | |
if ($argc < 2) { | |
echo "Usage: $argv[0] filename seconds [speed] | |
filename - name of subtitle file to read | |
seconds - amount of seconds to add to the times. If subtracting use negative values. eg: \"-5\" |
OlderNewer