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
/** assuming you have these in your <body> | |
<input id="textfield"></input> | |
<div id="container"></div> | |
**/ | |
var container = $('#container'); | |
var template = '<div><input></input></div>'; | |
var i = $('input#textfield').attr('id'); | |
i = parseInt(i); | |
while(i-- > 0){ | |
container.append(template); |
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
class Humanoid | |
attack: (target) -> | |
target.hp -= @damage | |
class Elf extends Humanoid | |
attack: (target) -> | |
super() | |
target.hp -= @magicBonus |
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
class Humanoid | |
attack: (target) -> | |
target.hp -= @damage | |
class Elf extends Humanoid | |
attack: (target) -> | |
super() | |
target.hp -= @magicBonus |
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
class Wol.Views.Marine extends Wol.Views.UnitView | |
init: -> | |
image = @model.getAsset 'marine' | |
frameData = FrameData.marine | |
frameData.images = [image] | |
spriteSheet = new SpriteSheet frameData | |
@animation = new BitmapAnimation spriteSheet | |
@el.addChild @animation | |
super() |
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
" Configuration file for vim | |
set modelines=0 " CVE-2007-2438 | |
" Normally we use vim-extensions. If you want true vi-compatibility | |
" remove change the following statements | |
set nocompatible " Use Vim defaults instead of 100% vi compatibility | |
set backspace=2 " more powerful backspacing | |
" Don't write backup file if vim is being called by "crontab -e" | |
au BufWrite /private/tmp/crontab.* set nowritebackup |
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 saveImage(canvasId) { | |
var canvas = document.getElementById(canvasId); | |
var dataUrl = canvas.toDataURL("image/png"); | |
return dataUrl; | |
} | |
// example | |
// <canvas id="myCanvas" /> | |
var imageUrl = saveImage('myCanvas'); |
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
class Animal | |
move: (x) -> @onMove x | |
onMove: (x) -> return | |
class Dog extends Animal | |
onMove: (x) -> # x is undefined | |
dog = new Dog() | |
dog.move 4 |
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
<link href="https://raw.github.com/jamesflorentino/nanoScrollerJS/master/bin/css/nanoscroller.css" rel="stylesheet" /> | |
<link href="test.css" rel="stylesheet" /> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<script src="https://raw.github.com/jamesflorentino/nanoScrollerJS/master/bin/javascripts/jquery.nanoscroller.min.js"></script> | |
<script src="test.js"></script> | |
<div id="bigText"> | |
<div class="nano"> |
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
// Cubic | |
easeInCubic = cubic-bezier(0.550, 0.055, 0.675, 0.190) | |
easeOutCubic = cubic-bezier(0.215, 0.610, 0.355, 1.000) | |
easeInOutCubic = cubic-bezier(0.645, 0.045, 0.355, 1.000) | |
// Circ | |
easeInCirc = cubic-bezier(0.600, 0.040, 0.980, 0.335) | |
easeOutCirc = cubic-bezier(0.075, 0.820, 0.165, 1.000) | |
easeInOutCirc = cubic-bezier(0.785, 0.135, 0.150, 0.860) |
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 store_reguser; | |
function usernameVer(in_, out) | |
{ | |
var ajaxRequest; | |
if (window.XMLHttpRequest) | |
{//Code for IE7+, Firefox, Chrome, Opera, Safari | |
ajaxRequest=new XMLHttpRequest(); | |
} | |
else |
OlderNewer