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 HashHack = { | |
| PREFIX: '#hhMessage=', | |
| postMessage: function(el, sMessage) { | |
| if ('string' === typeof el) { | |
| el = document.getElementById(el); | |
| } | |
| var sUrl = el.src.replace(/#.*/, ''); | |
| el.src = sUrl + HashHack.PREFIX + encodeURIComponent(sMessage); |
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 HashHack = { | |
| PREFIX: '#hhMessage=', | |
| aCallbacks: [], | |
| sLastHash: '', | |
| handleInterval: function() { | |
| var sHash = window.location.hash, | |
| sDecodedHash, sMessage, i; | |
| if (sHash !== HashHack.sLastHash) { |
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 myModule = angular.module('myModule', []); | |
| myModule.directive('foo', function(RecursionHelper){ | |
| return { | |
| restrict: "EAC", | |
| replace: true, | |
| template: '<strong>ok<div bar></div></strong>', | |
| compile: function(element) { | |
| // Use the compile function from the RecursionHelper, | |
| // And return the linking function(s) which it returns |
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
| // Copyright (c) 2012 Sutoiku, Inc. (MIT License) | |
| function NORMDIST(x, mean, sd, cumulative) { | |
| // Check parameters | |
| if (isNaN(x) || isNaN(mean) || isNaN(sd)) return '#VALUE!'; | |
| if (sd <= 0) return '#NUM!'; | |
| // Return normal distribution computed by jStat [http://jstat.org] | |
| return (cumulative) ? jStat.normal.cdf(x, mean, sd) : jStat.normal.pdf(x, mean, sd); | |
| } |
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
| source 'https://rubygems.org' | |
| # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
| gem 'rails', '4.2.1' | |
| # Use sqlite3 as the database for Active Record | |
| gem 'sqlite3' | |
| # Use SCSS for stylesheets | |
| gem 'sass-rails', '~> 5.0' | |
| # Use Uglifier as compressor for JavaScript assets |
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
| // Changes XML to JSON | |
| function xmlToJson(xml) { | |
| // Create the return object | |
| var obj = {}; | |
| if (xml.nodeType == 1) { // element | |
| // do attributes | |
| if (xml.attributes.length > 0) { | |
| obj["@attributes"] = {}; |
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
| # -*- coding: utf-8 -*- | |
| require 'rubygems' | |
| require 'RMagick' | |
| filename = ARGV.first | |
| unless filename | |
| warn "usage: #{$0} <ANIMATION GIF FILE>" | |
| exit 1 | |
| end |
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
| ApplicationController.new.render_to_string( | |
| :template => "v1/timers/index", | |
| :layout => false, | |
| :locals => { :@timers => Timer.all } | |
| ) |
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
| function rvm_install(){ | |
| gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
| \curl -sSL https://get.rvm.io | bash -s stable --ruby | |
| echo "source /home/$USER/.rvm/scripts/rvm" >> ~/.bash_profile | |
| echo "source /home/$USER/.rvm/scripts/rvm" >> ~/.zshrc | |
| } |
OlderNewer