Skip to content

Instantly share code, notes, and snippets.

Avatar
🐇
ʕ ◔ϖ◔ʔ < I'm a Rubyist.

Masayuki Izumi izumin5210

🐇
ʕ ◔ϖ◔ʔ < I'm a Rubyist.
View GitHub Profile
@izumin5210
izumin5210 / class_setter.coffee
Created Apr 20, 2014
【AngularJS】hover/active時にクラスを追加するdirective
View class_setter.coffee
app = angular.module 'MyApplication'
CLS_HOVER_DEFAULT = "hover"
CLS_ACTIVE_DEFAULT = "active"
app.directive 'clsHover', ->
restrict: 'A'
link: (scope, element, attrs, ctrl) ->
clsHover = attrs.clsHover || CLS_HOVER_DEFAULT
@izumin5210
izumin5210 / tab.html
Created Apr 20, 2014
【AngularJS】タブでコンテンツ切り替えするやつ
View tab.html
<div class="tab-pane" ng-show="active" ng-transclude>
</div>
@izumin5210
izumin5210 / newlines.coffee
Created Apr 20, 2014
【AngularJS】改行を有効にするためのフィルタ
View newlines.coffee
app = angular.module 'MyApplication'
app.filter 'noHTML', ->
(text) -> text.replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/&/, '&amp;') if text?
app.filter 'newlines', ($sce) ->
(text) -> $sce.trustAsHtml(if text? then text.replace(/\n/g, '<br />') else '')
app.controller 'testCtrl', ($scope) ->
$scope.iroha = 'いろはにほへと ちりぬるを\nわかよたれそ  つねならむ\nうゐのおくやま けふこえて\nあさきゆめみし ゑひもせす'
@izumin5210
izumin5210 / Gruntfile.coffee
Created Apr 6, 2014
Code for KOSEN 勉強会 #1 〜 先どり! 最近流行りの“アレ” 〜(http://codeforkosen.doorkeeper.jp/events/9585 )のライブコーディングで使ったGruntfileです.
View Gruntfile.coffee
module.exports = (grunt) ->
require('load-grunt-tasks')(grunt)
grunt.initConfig
coffee:
compile:
files: [
expand: true
cwd: 'src/coffeescripts'
src: ['**/*.coffee']