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 | |
/** | |
* Calculates a score for the given | |
* Github's user based on public events. | |
* | |
* @param string $username The Github's username. | |
* @return int The calculated score. | |
*/ | |
function getScoreForGithubUser(string $username): int |
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
if (! function_exists('human_readable_bytes')) { | |
/** | |
* Convert bytes in a human readable value. | |
* | |
* According to the specifications, for storage purpose use "metric" system. | |
* | |
* @see https://stackoverflow.com/a/38659168 | |
* @see https://en.wikipedia.org/wiki/Binary_prefix | |
* @param string $bytes |
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
(function (window, document) { | |
const isSmallSize = window.matchMedia('only screen and (max-width: 760px)').matches | |
const hasOrientation = screen.msOrientation || screen.mozOrientation || (screen.orientation || {}).type !== undefined | |
const firstAttempt = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) | |
const secondAttempt = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze |
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
(function(window, document) { | |
const rand = Math.random().toString(36).substr(2, 10); | |
const openClassName = 'opened'; | |
const componentName = 'toggleable'; | |
const triggerName = 'toggleable-trigger'; | |
const wrapperName = 'toggleable-content'; | |
const addToggleButton = wrapper => { | |
const button = document.createElement('button'); | |
const trigger = document.querySelector(`[${triggerName}]`); |
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
{{-- | |
Icon view component for Laravel 7. | |
@disclaimer The icons used in this component are taken from "Refactoring UI Heroicons" (md-outline collection). | |
For more info https://github.com/refactoringui/heroicons by Steve Schoger & Adam Wathan. | |
@copyright MIT | |
@author Maurizio <https://twitter.com/mauriziolepora> |
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
;(function(window, document) { | |
window.toggable = function() { | |
return { | |
// Local variables | |
show: false, | |
rand: Math.random().toString(36).substr(2, 10), | |
bodyNeedsOverflowHidden: false, | |
originalOverflow: '', |
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
export default class Notification extends HTMLElement { | |
constructor() { | |
super(); | |
this.render = () => { | |
this.setAttribute('role', 'status'); | |
this.setAttribute('aria-live', 'polite'); | |
} | |
} | |
connectedCallback() { |
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
<script> | |
export default { | |
props: { | |
open: { | |
type: Boolean, | |
default: false, | |
}, | |
}, | |
data() { | |
return { |
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
(function (window, navigator) { | |
'use strict'; | |
let isSmallSize = window.matchMedia("only screen and (max-width: 760px)").matches; | |
let hasOrientation = typeof window.orientation !== "undefined"; | |
let firstAttempt = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent); | |
let secondAttempt = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\ |
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
const _ = require('lodash') | |
module.exports = function ({addUtilities, e, theme, variants}) { | |
const rotate = theme('rotate', {}) | |
const rotateVariants = variants('rotate', []) | |
const utilities = _.map(rotate, (value, name) => ({ | |
[`.${e(`rotate-${name}`)}`]: { | |
transform: `rotate(${value})`, | |
transform: `rotate3d(0, 0, 1, ${value})` |