Skip to content

Instantly share code, notes, and snippets.

View apipkin's full-sized avatar
🤖
^_^

Anthony Pipkin apipkin

🤖
^_^
View GitHub Profile
@apipkin
apipkin / post-merge
Created May 14, 2016 21:22 — forked from sindresorhus/post-merge
git hook to run a command after `git pull` if a specified file was changed. In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed. Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@apipkin
apipkin / 0_reuse_code.js
Last active August 29, 2015 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@apipkin
apipkin / _getOffsetAndFinish.js
Created November 6, 2012 23:37 — forked from mattparker/_getOffsetAndFinish.js
idea for kb refactor of Y.Color.Harmony
/**
Generates a series of colors from startColor at various offsets
@protected
@method _getOffsetAndFinish
@param {String} startColor Start color
@param {Array} arrOffsets Array of colors
@param {String} [to]
@returns {Array} Of offsetted and finished colors
**/
_getOffsetAndFinish: function (startColor, arrOffsets, to) {
@apipkin
apipkin / gist:2037486
Created March 14, 2012 16:02 — forked from Tocacar/gist:2037474
YUI2in3 Calendar Plugin
/*
* @class AMS.Calendar
* @extends Widget
* @version 1.0.0
*
*/
YUI.add("ams-calendar", function (Y) {
Y.log('ams-calendar is loaded', 'info');
var YAHOO = Y.YUI2;
function (key, values, rereduce) {
// value -> [count, min, max, mean]
var i = 0
, l = values.length
, min = values[i][2] // set min to the first max
, max = 0
, weighted_sum_of_means = 0
, count = 0
, cur_count // just for clarity, feel free to remove later
, cur_min
@apipkin
apipkin / jquery-yui-widget.md
Created April 22, 2011 18:13
A comparison of the jQuery UI Widget Factory and the YUI 3 Widget class.

jQuery

Widget foo.js

(function($, undefined){
    
    $.widget('ui.foo', {
        
        options: {
<?php
$str = 'L�a�n�d�e�s�b�e�r�g�.�A�m�y�-�2�0�0�5�_�S�U�N�& o�r�a�n�g�e�,� �g�r�e�e�n�,� �b�l�u�e� �a�n�d� �b�l�u�e�_�4�w�e�b�.�j�p�g�';
echo $str;
echo '<br><br>';
echo cleanUpString($str);
YUI.add('collapsing-stalker', function(Y){
var CS = Y.Base.create('collapsing-stalker', Y.Plugin.Base, [], {
_host : null,
_clickBind : null,
initializer : function() {
Y.log('initializer','info','Y.Plugin.Xarno.CollapsingStalker');
<?php
while($c1=mysql_fetch_array($result1, MYSQL_ASSOC)) {
$sql2 = "SELECT `COL 3`,`COL 14` FROM `TABLE 1` WHERE `COL 3` = $c0[id]";
$result2 = mysql_query($sql2);
echo mysql_error();
while($c2=mysql_fetch_array($result2, MYSQL_ASSOC)) {
echo "<tr><td>ID: $c2[`COL 3`] </td></td> hours: $c2[`COL 14`] </td></tr>";
}
@apipkin
apipkin / gist:743882
Created December 16, 2010 19:44 — forked from joeauty/gist:743088
YUI.add('photogallery', function(Y){
Y.Photogallery = Y.Base.create('photogallery', Y.Widget, [], {
initCollectionObservers : function() {
// var gotoCollectionCallback = this.gotoCollection;
// var galleryAttributes = this.galleryAttributes;
Y.all('#collectionsul .collectionli .buttonWrapper').each(function(o) {
this.set('cid', o.get('id').replace(/^collection_/,''));
webkit.setupButton(o.get('id'), Y.bind(function(){ this.gotoCollection(this.getAttrs()); }, this), this);