Skip to content

Instantly share code, notes, and snippets.

View didicodethat's full-sized avatar

Mauricio didicodethat

View GitHub Profile
<!-- Assincrono -->
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- truepixel_sidebar-right-1_AdSense1_250x250_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:250px;height:250px"
data-ad-client="ca-pub-0645216011874310"
data-ad-slot="2615731312"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
FROM ruby:2.3.1
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /myapp
WORKDIR /myapp
ADD Gemfile /myapp/Gemfile
ADD Gemfile.lock /myapp/Gemfile.lock
ENV BUNDLE_PATH /box
RUN echo "Execute the bundle install on the web container with docker-compose run web bundle install"
ADD . /myapp
def authorize_mass_actions local_action
policy_name = if ['read_all', 'move_to_inbox', 'restore_messages'].include?(local_action)
:update?
else
:destroy?
end
Message.with_deleted.where(id: params[:messages_ids]).each do |message|
authorize(message, policy_name)
end
################################### Logging ####################################
## Logging configuration as json
## Defaults to: None
#THUMBOR_LOG_CONFIG = None
## Log Format to be used by thumbor when writing log messages.
## Defaults to: %(asctime)s %(name)s:%(levelname)s %(message)s
#THUMBOR_LOG_FORMAT = '%(asctime)s %(name)s:%(levelname)s %(message)s'
const repl = require('repl')
const readline = require('readline')
const nil = {_active: false, _nil: true}
// Helper Functions
const callOnEachKey = (object, method_name, ...args) => {
for(let key in object){
object[key][method_name](...args)
}
}
module.exports = function initAbsoluteSideLine($, mainSelector, $window, $document){
var line = $('<div class="absolute-side-line"></div>');
line.css('position', 'absolute');
var offsets = $(mainSelector).map(function(k,el){
var element = $(el);
return {top: function(){ return element.offset().top; }, height: element.height.bind(element)};
}).toArray();
var getActualSectionOnPosition = function(actualTop){
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"A File Icon",
"Advanced CSV",
"AutoFoldCode",
@didicodethat
didicodethat / YoutubeUrlParser.php
Last active September 15, 2017 17:49
A simple multipurpose php youtube url parser, this was used for specific needs so it is not really generic.
<?php
class YoutubeUrlParser
{
const REGULAR_URL_FORMAT = '/^https?:\/\/(www\.)?youtube\.com\/watch/';
const EMBEDDED_URL_FORMAT = '/^https?:\/\/(www\.)?youtube\.com\/embed/';
const SHARE_URL_FORMAT = '/^https?:\/\/(www\.)?youtu\.be\//';
private $originalUrl;
private $videoId;
return function(graphics, x, y, rx, ry, angle, size, distance)
local g = graphics
local i
local size = size or 1
local half = size/2
local distance = distance or 1
for i = 0, 15 do
g.origin()
g.translate(x, y - (i * distance) )
@didicodethat
didicodethat / Numpad 0 as Cookie Click
Last active January 29, 2018 16:15
Simple plugin to bind a keyboard key as a cookie click