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
data:text/html, <style type="text/css">.e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div class="e" id="editor"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("editor");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> | |
<!-- | |
For other language: Instead of `ace/mode/ruby`, Use | |
Markdown -> `ace/mode/markdown` | |
Python -> `ace/mode/python` | |
C/C++ -> `ace/mode/c_cpp` | |
Javscript -> `ace/mode/javascript` | |
Java -> `ace/mode/java` | |
Scala- -> `ace/mode/scala` |
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
app.directive('ngEnter', function() { | |
return function(scope, elm, attrs) { | |
elm.bind('keypress', function(event) { | |
var modifier = event.ctrlKey || event.metaKey; | |
if (modifier && event.charCode === 13) scope.$apply(attrs.ngEnter); | |
}); | |
}; | |
}); |
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 logProvider(){ | |
return function (){ | |
console.log.apply(console, arguments); | |
} | |
} | |
function scopeProvider($dbAdapter){ | |
this.someVariable = $dbAdapter.getText(); | |
//this.someVariable = 'Some text'; |
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
angular.module('ui') | |
.directive('ngSticky', function($window) { | |
return function($scope, element) { | |
var start, | |
$win = element($window); | |
$win.on('scroll', function() { | |
var scroll = $win.scrollTop(); |
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
app.factory('FileReader', function($q, $window) { | |
if (!$window.FileReader) { | |
throw new Error('Browser does not support FileReader'); | |
} | |
function readAsDataUrl(file) { | |
var deferred = $q.defer(), | |
reader = new $window.FileReader(); |
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 md5(str) { | |
// discuss at: http://phpjs.org/functions/md5/ | |
// original by: Webtoolkit.info (http://www.webtoolkit.info/) | |
// improved by: Michael White (http://getsprink.com) | |
// improved by: Jack | |
// improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
// input by: Brett Zamir (http://brett-zamir.me) | |
// bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) | |
// depends on: utf8_encode | |
// example 1: md5('Kevin van Zonneveld'); |
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 doesConnectionExist() { | |
var xhr = new XMLHttpRequest(); | |
var file = "http://www.yoursite.com/somefile.png"; | |
var randomNum = Math.round(Math.random() * 10000); | |
xhr.open('HEAD', file + "?rand=" + randomNum, false); | |
try { | |
xhr.send(); | |
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 css = "text-shadow: -1px -1px hsl(0,100%,50%), 1px 1px hsl(5.4, 100%, 50%), 3px 2px hsl(10.8, 100%, 50%), 5px 3px hsl(16.2, 100%, 50%), 7px 4px hsl(21.6, 100%, 50%), 9px 5px hsl(27, 100%, 50%), 11px 6px hsl(32.4, 100%, 50%), 13px 7px hsl(37.8, 100%, 50%), 14px 8px hsl(43.2, 100%, 50%), 16px 9px hsl(48.6, 100%, 50%), 18px 10px hsl(54, 100%, 50%), 20px 11px hsl(59.4, 100%, 50%), 22px 12px hsl(64.8, 100%, 50%), 23px 13px hsl(70.2, 100%, 50%), 25px 14px hsl(75.6, 100%, 50%), 27px 15px hsl(81, 100%, 50%), 28px 16px hsl(86.4, 100%, 50%), 30px 17px hsl(91.8, 100%, 50%), 32px 18px hsl(97.2, 100%, 50%), 33px 19px hsl(102.6, 100%, 50%), 35px 20px hsl(108, 100%, 50%), 36px 21px hsl(113.4, 100%, 50%), 38px 22px hsl(118.8, 100%, 50%), 39px 23px hsl(124.2, 100%, 50%), 41px 24px hsl(129.6, 100%, 50%), 42px 25px hsl(135, 100%, 50%), 43px 26px hsl(140.4, 100%, 50%), 45px 27px hsl(145.8, 100%, 50%), 46px 28px hsl(151.2, 100%, 50%), 47px 29px hsl(156.6, 100%, 50%), 48px 30px hsl(162, 100%, 50%), 49px 31px hsl(167.4, 100%, 5 |
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 goImage(){ | |
html2canvas(document.getElementById('Stage_screen'), { | |
onrendered: function(canvas) { | |
window.location = canvas.toDataURL('image/jpeg'); | |
} | |
}); | |
} |
OlderNewer