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
import { morphElement } from '../../helpers' | |
import MorphableSnapshot from './morphable_snapshot' | |
// A Renderer class that will extract morphable elements tagged with [data-turbo-morph] before | |
// rendering, and morph them back into the new snapshot after rendering, similar to how permanent | |
// elements are handled by Turbo. Useful for persisting horizontal scroll etc. | |
// | |
// Note: A morphable element must have an [id] attribute. | |
class MorphRenderer { |
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
class Preloader { | |
static delay = 100 | |
constructor (element) { | |
this.element = element | |
this.element.addEventListener("mouseenter", this.didMouseEnter) | |
this.element.addEventListener("mouseleave", this.didMouseLeave) | |
} |
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
<?php | |
require_once('emoji.php'); // Provides a $GLOBALS['emoji_maps'] etc.. | |
function emoji_unified_to_code($text){ | |
return preg_replace_callback($GLOBALS['emoji_maps']['unified_rx'], function($m){ | |
if (isset($m[2]) && $m[2] == "\xEF\xB8\x8E") return $m[0]; | |
$cp = $GLOBALS['emoji_maps']['unified_to_html'][$m[1]]; | |
return "[emoji{$cp}]"; | |
}, $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
Resque.workers.each do |worker| | |
worker.unregister_worker if Time.parse(worker.started) < 1.day.ago | |
end |
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
def self.import(subscribers, list_id) | |
# `subscribers` should be an array of hashed subscribers with :email as key and optionally :data as well. | |
# Generate CSV: | |
content = CSV.generate(:force_quotes => true, :col_sep => ";") do |csv| | |
# First row is the headers row: | |
fields = [:email] | |
# Add additional data keys: | |
if data_keys = subscribers.first[:data].try(:keys) |
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
# Update, upgrade and install development tools: | |
apt-get update | |
apt-get -y upgrade | |
apt-get -y install build-essential git-core curl libssl-dev \ | |
libreadline5 libreadline5-dev \ | |
zlib1g zlib1g-dev \ | |
libmysqlclient-dev \ | |
libcurl4-openssl-dev \ | |
libxslt-dev libxml2-dev |
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
SearchSession.prototype = { | |
initialize: function(options) { | |
this.options = options; | |
this.render(); | |
}, | |
render: function() { | |
// Run through the criterias: | |
$.each(this.options.data, function(key, data) { | |
this.addCriteria(key, data).render(); |
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
15265 <... epoll_wait resumed> {}, 8192, 500) = 0 | |
15200 <... epoll_wait resumed> {}, 8192, 1000) = 0 | |
15265 epoll_wait(44, <unfinished ...> | |
15200 accept(20, 0x7f33b525a270, [28]) = -1 EAGAIN (Resource temporarily unavailable) | |
15200 epoll_wait(24, <unfinished ...> | |
15278 <... epoll_wait resumed> {}, 8192, 1000) = 0 | |
15266 <... epoll_wait resumed> {}, 8192, 500) = 0 | |
25861 <... epoll_wait resumed> {}, 8192, 500) = 0 | |
15278 accept(85, <unfinished ...> | |
25861 epoll_wait(2763, <unfinished ...> |
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
class WorkoutLink < ActiveRecord::Base | |
belongs_to :workout | |
YOUTUBE_REGEXP = /youtu(?:\.be\/|be\.com\/watch\?v=)(\w{11})/ | |
VIMEO_REGEXP = /vimeo\.com\/([\d+]+)/ | |
def youtube_video_id | |
$1 if url =~ YOUTUBE_REGEXP | |
end | |
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
Dating: http://netdate.dk/ |
NewerOlder