Skip to content

Instantly share code, notes, and snippets.

@kentcdodds
kentcdodds / index.html
Last active June 24, 2021 19:48
The one true react boilerplate
<body>
<div id="⚛️"></div>
<script src="https://unpkg.com/react@16.0.0/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16.0.0/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.26.0/babel.js"></script>
<script type="text/babel">
ReactDOM.render(<div>Hello World!</div>, document.getElementById('⚛️'))
</script>
</body>
@pladaria
pladaria / .svgo.yml
Last active February 7, 2023 17:15
SVGO config file
multipass: true
plugins:
- addAttributesToSVGElement: false
- addClassesToSVGElement: false
- cleanupAttrs: true
- cleanupEnableBackground: true
- cleanupIDs: true
- cleanupListOfValues: true
- cleanupNumericValues:
@laat
laat / random_navn.js
Last active March 10, 2019 21:52
tilfeldig seedet navn basert på fødselsnummer
var seedrandom = require('seedrandom');
var jentenavn = ['Anne','Inger','Kari','Marit','Ingrid','Liv','Eva','Berit','Astrid','Bjørg','Hilde','Anna','Solveig','Marianne','Randi','Ida','Nina','Maria','Elisabeth','Kristin','Bente','Heidi','Silje','Hanne','Gerd','Linda','Tone','Tove','Elin','Anita','Wenche','Ragnhild','Camilla','Ellen','Karin','Hege','Ann','Else','Mona','Marie','Aud','Monica','Julie','Kristine','Turid','Laila','Reidun','Stine','Helene','Åse','Jorunn','Sissel','Mari','Line','Lene','Mette','Grethe','Trine','Unni','Malin','Grete','Thea','Gunn','Emma','May','Ruth','Lise','Emilie','Anette','Kirsten','Sara','Nora','Linn','Eli','Siri','Cecilie','Irene','Marte','Gro','Britt','Ingeborg','Kjersti','Janne','Siv','Sigrid','Karoline','Karen','Vilde','Martine','Tonje','Andrea','Sofie','Torill','Synnøve','Rita','Jenny','Cathrine','Elise','Maren','Hanna','Lillian','Lena','Brit','Vigdis','Therese','Frida','Amalie','Ingvild','Ingunn','Bodil','Charlotte','Signe','Lisbeth','Sandra','Christine','Victoria','Marthe','C

Port Forwarding in Mavericks (80 to 8080)


Guide to add localhost:80 to localhost:8080 forwarding.

Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file

@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
@james2doyle
james2doyle / scrollTo.js
Last active November 29, 2023 11:41
a native scrollTo function in javascript that uses requestAnimationFrame and easing for animation
// easing functions http://goo.gl/5HLl8
Math.easeInOutQuad = function (t, b, c, d) {
t /= d/2;
if (t < 1) {
return c/2*t*t + b
}
t--;
return -c/2 * (t*(t-2) - 1) + b;
};
@Warry
Warry / Article.md
Created December 11, 2012 00:11
How to make faster scroll effects?

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

@jonathanmoore
jonathanmoore / gist:2640302
Created May 8, 2012 23:17
Get the share counts from various APIs

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.

Twitter

@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@endolith
endolith / Has weird right-to-left characters.txt
Last active April 30, 2024 12:48
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶