View CloudApp Theater Mode.user.js
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
// ==UserScript== | |
// @name CloudApp Theater Mode | |
// @namespace http://tampermonkey.net/ | |
// @version 0.4 | |
// @description CloudApp theater mode UI redesign. Maximum size video, and move toolbox buttons into nav bar. | |
// @author colder | |
// @homepage https://github.com/cncolder | |
// @updateURL https://gist.github.com/cncolder/2f223ee6fb4b4cb5fa63bb9d1484d5b5/raw/CloudApp%2520Theater%2520Mode.user.js | |
// @match https://share.getcloudapp.com/* | |
// @icon https://public.getcloudapp.com/packs/media/images/cloudapp-favicon-d053fc47958e1b85c892b5de0d7ac93a.png |
View gist:97b0e048ef1b756f25df814faacfd2e7
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
// VSCode Settings - Jest run it - Jest Path | |
node -e '[_,f,...a]=process.argv;d=path.dirname(f).replace(/\\/g,"");j=require.resolve("jest",{paths:[d]});b=path.resolve(j,"../../bin/jest.js");child_process.spawnSync(b,[f,...a],{cwd:d,stdio:"inherit"})' |
View .eslintrc.js
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
// Put me under ./src | |
module.exports = { | |
extends: 'react-app', | |
rules: { | |
eqeqeq: 'off' | |
} | |
} |
View lazy factory girl.rb
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
# spec/factories.rb | |
class F | |
class << self | |
{:a => :attributes_for, :b => :build, :c => :create, :d => :define, :s => :stub, :* => :sequence, :+ => :next}.each do |k,v| | |
delegate v, :to => Factory | |
alias_method k, v | |
end | |
end | |
end |
View application.js
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
//BUGFIX: Chromeframe miss some features. | |
(function($) { | |
$.oldAjax = $.ajax; | |
$.ajax = function(o) { | |
// I can't detect it by navigator.userAgent. So I set it on server side. | |
if (navigator.chromeframe) { | |
// Chromeframe can't send DELETE and PUT verb. | |
if (o.type == "DELETE") { | |
o.type = "POST"; |
View application.html.erb
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
<!-- Hold it in application.html.erb or ur own default layout. for this example put in navigator. --> | |
<% if @win_ie_with_chromeframe %> | |
<script> | |
navigator.chromeframe = true; | |
</script> | |
<% end -%> |
View rails.js
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
// Live is new method in jQuery 1.4+. | |
$('a[data-confirm]').live('click', function () { ... }); | |
// When user click the link. jQuery will handle it and send a ajax request. | |
$.ajax({ | |
url: "/users/new", | |
dataType: "script", | |
... | |
}); |
View user.html.erb
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
<!-- Rails html5 templete --> | |
<%= link_to "Add user", new_user_path, :remote => true %> | |
<!-- Will product --> | |
<a href="/users/new" data-remote="true">Add user</a> |
View Concat my name use ruby magic.rb
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
# Print "colder" | |
(_=%!%!<<(?#+?@))&&_%(?#+?@)+_%(?/+?@)+_%(?,+?@)+_%(?$+?@)+_%(?%+?@)+_%(?#+?%+?*) |
View gist:410523
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
<html> | |
<head> | |
<title>IE PNG Alpha Fix</title> | |
<style type="text/css"> | |
img { behavior: url("iepngfix.htc") } | |
</style> | |
</head> | |
<body bgcolor="#000000"> | |
<img src="opacity.png"/> | |
</body> |
NewerOlder