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
Translation of Google Maps Code (html + js) to haml + coffeescript | |
------------------------------------------------------------------- | |
assets/javascript/application.js | |
-------------------------------- | |
// | |
//= require jquery | |
//= require jquery_ujs | |
//= require_tree . | |
assets/javascript/maps.js.coffee |
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
_elems = [] | |
if type is 'modify' | |
_elems.push e.model for e in elems | |
else | |
_elems.push e.model for e in @foo.elems |
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
global[r] = require r for r of <[js path wrench]> | |
BOM = String.fromCharCode BOM_CHAR_CODE = 65279 | |
wrench.readdirSyncRecursive process.cwd! .forEach (filename) -> | |
return unless \js is path.extname filename | |
error, content <-! fs.readFile fileName, \utf8 | |
throw that if error |
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
#Controller | |
def action | |
@tm=Random.rand(11) | |
render :layout => false | |
end | |
#View | |
#action.haml | |
=@tm |
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
# thanks to railscasts | |
class Object | |
# macvim | |
def mvim(method_name) | |
file, line = method(method_name).source_location | |
`mvim #{file} +#{line}` | |
end | |
# sublime 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
Foo = DataSource: {} | |
class Foo.DataSource.REST | |
(@baseUrl) -> | |
fetchAll: !-> | |
@doRequest("GET", @baseUrl, | |
success: (data, event, response) -> | |
console.debug data | |
) | |
fetch: !(id) -> |
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
<div itemscope itemtype="http://schema.org/Person" class='user_details'> | |
<span class='hide' itemprop="name">{$author['members_display_name']}</span> | |
<ul class='basic_info'> | |
<if test="membertitle:|:$author['member_title']"> | |
<p class='desc member_title'>{$author['member_title']}</p> | |
</if> | |
<if test="avatar:|:$author['member_id']"> | |
<li class='avatar'> | |
<if test="canSeeProfiles:|:$this->memberData['g_is_supmod'] OR ( $this->memberData['g_mem_info'] && ! IPSMember::isInactive( $author ) )"> | |
<a itemprop="url" href="{parse url="showuser={$author['member_id']}" template="showuser" seotitle="{$author['members_seo_name']}" base="public"}" title="{$this->lang->words['view_profile']}: {$author['members_display_name']}" class='ipsUserPhotoLink'> |
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
$(".datatable").dataTable | |
bPaginate: true | |
bFilter: true | |
sScrollY: '90%' | |
fnDrawCallback: -> | |
$('.dataTables_scrollBody').addClass('user-panel').jScrollPane {"contentWidth": 480} | |
return |
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
my @a = ('99 bottles', 'take one down', '98 bottles'); | |
for @a { | |
say "$^a of beer on the wall, $^a of beer.$^b, $^c of beer on the wall.".tc; | |
} | |
my @b = ('99 bottles', 'take one down', '98 bottles'), ('98 bottles', 'take one down', '97 bottles'); | |
say @b.perl; | |
for @b { | |
say "$^a of beer on the wall, $^a of beer.$^b, $^c of beer on the wall.".tc; | |
} |
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
News: | |
connection: other | |
actAs: [ Timestampable ] | |
columns: | |
author_id: int(9) | |
title: varchar(255) | |
content: text | |
relations: | |
Comments: | |
class: Comment |
OlderNewer