This is a CFP for ReactiveConf 2017's open call for Lightning talks. If you'd like to see this talk become a reality, please ⭐ star this gist. #ReactiveConf
This file contains hidden or 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
| defmodule StrongParams do | |
| def extract(params, allowed_fields, atomize \\ false) | |
| def extract(params, allowed_fields, atomize) when not is_list(allowed_fields), | |
| do: extract(params, [allowed_fields], atomize) | |
| def extract(params, allowed_fields, atomize) | |
| when is_map(params) and is_list(allowed_fields) do | |
| Enum.reduce(allowed_fields, %{}, fn field, acc -> | |
| case extract_field(field, params, atomize) do |
This file contains hidden or 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 BooleanValue | |
| # https://github.com/rails/rails/blob/master/activemodel/lib/active_model/type/boolean.rb | |
| FALSE_VALUES = [ | |
| false, 0, | |
| "0", :"0", | |
| "f", :f, | |
| "F", :F, | |
| "false", :false, | |
| "FALSE", :FALSE, | |
| "off", :off, |
This file contains hidden or 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 cloneWithProps = React.addons.cloneWithProps; | |
| var SmartSortable = React.createClass({ | |
| getDefaultProps: function() { | |
| return {component: "ul", childComponent: "li"}; | |
| }, | |
| render: function() { | |
| var props = jQuery.extend({}, this.props); |
This file contains hidden or 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
| <script type="text/javascript"> | |
| (function () { | |
| "use strict"; | |
| // once cached, the css file is stored on the client forever unless | |
| // the URL below is changed. Any change will invalidate the cache | |
| var css_href = './index_files/web-fonts.css'; | |
| // a simple event handler wrapper | |
| function on(el, ev, callback) { | |
| if (el.addEventListener) { | |
| el.addEventListener(ev, callback, false); |
This file contains hidden or 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
| application:open-your-keymap | |
| application:open-your-stylesheet | |
| autocomplete:attach | |
| autoflow:reflow-paragraph | |
| bookmarks:clear-bookmarks | |
| bookmarks:jump-to-next-bookmark | |
| bookmarks:jump-to-previous-bookmark | |
| bookmarks:toggle-bookmark | |
| bookmarks:view-all | |
| check:correct-misspelling |
This file contains hidden or 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>Test</title> | |
| <script src="http://code.jquery.com/jquery-1.9.1.js"></script> | |
| <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> | |
| <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> | |
| <script src="http://fb.me/react-0.5.1.js"></script> | |
| <script src="http://fb.me/JSXTransformer-0.5.1.js"></script> | |
| </head> |
This file contains hidden or 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
| Number.prototype.mod = function(n) { | |
| return ((this%n)+n)%n; | |
| } | |
| // support for adding/subtracting business days for Javascript dates | |
| Date.prototype.addBusinessDays = function(days) { | |
| days = parseInt(days); | |
| var wks = Math.floor(days/5); | |
| var dys = days.mod(5); | |
| var dy = this.getDay(); |
This file contains hidden or 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
| videos = document.getElementsByTagName('video') | |
| new VideoSync(videos[0], videos[1]) |
This file contains hidden or 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
| @import compass | |
| $icons: sprite-map("icons/*.png") | |
| $icons-hd: sprite-map("icons-hd/*.png") | |
| i | |
| background: $icons | |
| display: inline-block | |
| @media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) | |
| background: $icons-hd |
NewerOlder
