Give developers more knowledge about how the classes behave in a non-relative sense: BEM + ITCSS = BEMIT
BEM:
Give developers more knowledge about how the classes behave in a non-relative sense: BEM + ITCSS = BEMIT
BEM:
| class PostsController < ActionController::Base | |
| def create | |
| Post.create(post_params) | |
| end | |
| def update | |
| Post.find(params[:id]).update_attributes!(post_params) | |
| end | |
| private |
| ; This is a complete solution to map the CapsLock key to Control and Escape without losing the ability to toggle CapsLock | |
| ; We use two tools here - any remapping software to map CapsLock to LControl and AutoHotkey to execute the following script | |
| ; This has been tested with MapKeyboard (by Inchwest) | |
| ; This will allow you to | |
| ; * Use CapsLock as Escape if it's the only key that is pressed and released within 300ms (this can be changed below) | |
| ; * Use CapsLock as LControl when used in conjunction with some other key or if it's held longer than 300ms | |
| ; * Toggle CapsLock by pressing LControl/CapsLock + RControl | |
| ~*LControl:: |
| String.prototype.imgURL = function(size) { | |
| // remove any current image size then add the new image size | |
| return this | |
| .replace(/_(pico|icon|thumb|small|compact|medium|large|grande|original|1024x1024|2048x2048|master)+\./g, '.') | |
| .replace(/\.jpg|\.png|\.gif|\.jpeg/g, function(match) { | |
| return '_'+size+match; | |
| }) | |
| ; | |
| }; |
Handy helpers for controlling visibility of elements until Vue has compiled.
Use like:
<div v-cloak>
<h1>
<span class="v-cloak--inline">Loading...</span> <!-- Only displayed before compiling -->
<span class="v-cloak--hidden">{{ post.title }}</span> <!-- Hidden until compiling is finished -->
| Regex search and replace for form helpers as follows: | |
| Search: | |
| \{\{ (Form\:\:.+) \}\} | |
| Replace: | |
| {!! $1 !!} |
| <templateSet group="BenSmith-Annotations"> | |
| <template name="anno" value="/** * $ANNOTATIONS$ * @return Response */" description="Add docblock ready for annotations below" toReformat="false" toShortenFQNames="true"> | |
| <variable name="ANNOTATIONS" expression="" defaultValue="" alwaysStopAt="true" /> | |
| <context> | |
| <option name="HTML_TEXT" value="true" /> | |
| <option name="HTML" value="true" /> | |
| <option name="PHP" value="true" /> | |
| </context> | |
| </template> | |
| <template name="@G" value="@Get("$ROUTE$", as="$NAME$")" description="Get route annotation" toReformat="false" toShortenFQNames="true"> |
| <?php | |
| // Creating your own class | |
| namespace Your\Namespace; | |
| use Corcel\Post as Corcel; | |
| class Post extends Corcel | |
| { |
| var email_address = 'derek@wpromote.com'; | |
| function main() { | |
| var urlList = runUrlReport(); | |
| urlList = _.uniq(urlList, function(item, key, url) { | |
| return item.url; | |
| }); | |
| var listOfBrokenUrls = []; |