Skip to content

Instantly share code, notes, and snippets.

@gtnsimon
gtnsimon / doctrine_validator_swagger.md
Last active February 26, 2024 12:14
Doctrine ORM + Symfony Validator + Swagger-PHP annotations living together 🙌❤

This solve Exceptions below :

  • Doctrine\Common\Annotations\AnnotationException : [Semantical Error] The annotation "..." in property Class::$property does not exist, or could not be auto-loaded.
  • Doctrine\ORM\Mapping\MappingException : Class "..." is not a valid entity or mapped super class.

Packages

@anonoz
anonoz / Dockerfile
Created March 26, 2018 03:13
Sample of multistage Dockerfile for Rails app in production
FROM madnight/docker-alpine-wkhtmltopdf as wkhtmltopdf_savior
# STAGE for bundle & yarn install
FROM ruby:2.4.3-alpine3.7 as builder
ENV CA_CERTS_PATH /etc/ssl/certs/
ENV RAILS_ENV production
ENV RAILS_LOG_TO_STDOUT true
ENV RAILS_SERVE_STATIC_FILES true

Erlang/Elixir syntax reference

This reference is aimed at allowing you to comfortably read erlang documentation and consume terms printed in Erlang format. It does not aim at allowing you to write Erlang code.

This is a modified version of http://elixir-lang.org/crash-course.html

Data types

Erlang and Elixir have the same data types for the most part, but there are a number of differences.

@wbotelhos
wbotelhos / clear-sidekiq-jobs.sh
Last active June 6, 2025 20:27
Clear Sidekiq Jobs
require 'sidekiq/api'
# 1. Clear retry set
Sidekiq::RetrySet.new.clear
# 2. Clear scheduled jobs
Sidekiq::ScheduledSet.new.clear

File sizes of the web components' polyfills and Polymer

Version size (minified) size (minified & gzipped)
0.4.2 webcomponents.js 127KB 37KB
0.5.5 webcomponents.js 99KB 28KB
webcomponents-lite.js 28KB 8.8KB
0.6.0 webcomponents.js 108KB 31KB
webcomponents-lite.js 35KB 11KB
@Turbo87
Turbo87 / app.js
Created February 15, 2015 04:05
webpack + font-awesome test
require('font-awesome/css/font-awesome.css');
document.body.innerHTML = '<i class="fa fa-fw fa-question"></i>';
@elgalu
elgalu / waitReady.js
Last active February 2, 2021 07:14
Actively wait for an element present and displayed up to specTimeoutMs ignoring useless webdriver errors like StaleElementError.
/**
* Actively wait for an element present and displayed up to specTimeoutMs
* ignoring useless webdriver errors like StaleElementError.
*
* Usage:
* Add `require('./waitReady.js');` in your onPrepare block or file.
*
* @example
* expect($('.some-html-class').waitReady()).toBeTruthy();
*/
@addyosmani
addyosmani / README.md
Last active June 6, 2025 20:57 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@branneman
branneman / better-nodejs-require-paths.md
Last active May 15, 2025 11:17
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

anonymous
anonymous / Animated-Map-Marker.markdown
Created September 23, 2013 19:33
A Pen by roybarber.

Animated Map Marker

Simple animated map marker using css3 keyframes to animate a border/object size to create a pulsating effect

A Pen by roybarber on CodePen.

License.