At only 26 bytes, this GIF is based on the article The Tiniest GIF Ever and comment by "Example"
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 {useLayoutEffect, useRef} from 'react'; | |
export default ({onChange}) => { | |
const myRef = useRef(); | |
const updatePosition = () => { | |
const rect = myRef.current.getBoundingClientRect(); | |
onChange(rect); | |
}; | |
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
license: gpl-3.0 |
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
/** | |
* @author Freddie Mercury | |
* @copyright Sony/ATV Music Publishing LLC | |
*/ | |
let BohemianRhapsody = function(){ | |
// Is this the real life? | |
// Is this just fantasy? | |
try { |
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
-- run with "osascript keystroke.scpt APPNAME KEY MODIFIER" | |
on run params | |
set frontApp to (path to frontmost application as text) | |
set appl to item 1 of params | |
set keyy to item 2 of params | |
if frontApp is not equal to appl then | |
tell application appl |
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
@mixin tag($fcolor,$color,$bcolor) | |
$border-radius: 0.3 | |
$nohyp: (1.95) * sin(45deg) // 1.95 = height in ems including padding, minus border radius | |
padding: .4em .6em | |
border-radius: #{$border-radius}em | |
background-color: $color | |
color: $fcolor | |
z-index: 1 | |
margin-right: #{$nohyp}em | |
&:before |
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
var cl,ce,cw; | |
if(window.console && console.log){ | |
cl = console.log; | |
console.log = function(){ | |
MyLogFunction(arguments); | |
cl.apply(this, arguments) | |
} | |
} |
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
# Use Gists to store entire functions | |
class QuickSort | |
def self.sort!(keys) | |
quick(keys,0,keys.size-1) | |
end | |
private | |
def self.quick(keys, left, right) |
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
'use strict'; | |
// Add ECMA262-5 method binding if not supported natively | |
// | |
if (!('bind' in Function.prototype)) { | |
Function.prototype.bind= function(owner) { | |
var that= this; | |
if (arguments.length<=1) { | |
return function() { | |
return that.apply(owner, arguments); |
NewerOlder