Here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft CMS.
The attack detailed below has stopped (for the time being) and almost all network access for almost all customers have been restored. We're keeping this post and the timeline intact for posterity. Unless the attack resumes, we'll post a complete postmortem within 48 hours (so before Wednesday, March 26 at 11:00am central time).
Criminals have laid siege to our networks using what's called a distributed denial-of-service attack (DDoS) starting at 8:46 central time, March 24 2014. The goal is to make Basecamp, and the rest of our services, unavailable by flooding the network with bogus requests, so nothing legitimate can come through. This attack was launched together with a blackmail attempt that sought to have us pay to avoid this assault.
Note that this attack targets the network link between our servers and the internet. All the data is safe and sound, but nobody is able to get to it as long as the attack is being successfully executed. This is like a bunch of people
If you're doing stuff with Ruby on a Mac, e.g. installling Jekyll or something, by default you'll end up having to use the sudo command to do stuff, since the permission to modify the default config is not available to your user account.
This sucks and should be avoided. Here's how to fix that.
To make this better, we are going install a new, custom Ruby. This used to be a big, scary thing, but thanks to the awesome tools Homebrew and rbenv, it's a snap.*
A word of warning: you will have to use Terminal to install this stuff. If you are uncomfortable with text, words, and doing stuff with your computer beyond pointing and hoping, this may not work well for you. But if that's the case, I'm not sure why you were trying to use Ruby in the first place.
| <?php | |
| /** | |
| * Given a string containing any combination of YouTube and Vimeo video URLs in | |
| * a variety of formats (iframe, shortened, etc), each separated by a line break, | |
| * parse the video string and determine it's valid embeddable URL for usage in | |
| * popular JavaScript lightbox plugins. | |
| * | |
| * In addition, this handler grabs both the maximize size and thumbnail versions | |
| * of video images for your general consumption. In the case of Vimeo, you must | |
| * have the ability to make remote calls using file_get_contents(), which may be |
| (function() { | |
| var defaultFrameRate = 20, // fps lock for old browsers | |
| // This is the default fallback throttle function | |
| framerateThrottle = function(callback) { | |
| return _.throttle(callback, 1 / (defaultFrameRate * 1000)); | |
| }; | |
| // Feature detection - should have requestAnimationFrame | |
| if (window.requestAnimationFrame) { | |
| framerateThrottle = function(callback) { |
| #!/bin/bash -e | |
| # Wrapper for the toggle_alfred_theme.py script at | |
| # https://gist.github.com/deanishe/ce442c3a768adedc9c39 | |
| # (where this script also comes from) | |
| # | |
| # The purpose of this wrapper is to enable you to update the Python script | |
| # without having to edit the script to change the settings each time. You keep | |
| # them in here instead, and this script should hopefully prove dumb enough | |
| # to require little updating... |
| // Implementation in ES6 | |
| function pagination(c, m) { | |
| var current = c, | |
| last = m, | |
| delta = 2, | |
| left = current - delta, | |
| right = current + delta + 1, | |
| range = [], | |
| rangeWithDots = [], | |
| l; |
| @function up-to($list, $index) { | |
| $l: (); | |
| @each $e in $list { | |
| @if length($l) < $index { | |
| $l: append($l, $e, list-separator($list)); | |
| } | |
| } | |
| @return $l; | |
| } |
A simple Webpack + Gulpfile configuration wihtout any need for React.js that assumes you have the following project structure:
node_modules/
bower_components/
scripts/
Entry script is in scripts/entry.js
You should run gulp && gulp build-dev and you are good to go.