Skip to content

Instantly share code, notes, and snippets.

View fiuzagr's full-sized avatar
🌱
Seeding

Fiuza fiuzagr

🌱
Seeding
View GitHub Profile
@rickbutterfield
rickbutterfield / polyfill.js
Last active November 25, 2020 18:03
Polyfill getTotalLength support for SVG circles on iOS
/**
* Polyfill SVG path support for iOS
*/
SVGCircleElement.prototype.getTotalLength = function() {
let width = this.parentNode.clientWidth, // Get the parent node width (trying to get the current node width returns 0)
radius = width / 2, // Get the radius by dividing by 2
length = 2 * Math.PI * radius; // Get the circumference from 2πr
// Return the calculated value
return length;
@mpolci
mpolci / dynamic-redux-sagas.md
Last active January 14, 2022 22:05
Helper function creating a dynamic saga for code splitting with redux-saga

Helper function

This function create a saga that runs the sagas in the startingSagas array and takes the actions with type indicated by changeActionType to replace the running sagas. The replacing actions must have a field sagas cointaining the array with the new sagas.

function createDynamicSaga (changeActionType, startingSagas) {
  function* _start (sagas) {
    try {
      yield sagas
@tatocaster
tatocaster / speedtest.js
Created April 8, 2016 21:13
speedtest.js
(function() {
var imageAddr = "https://upload.wikimedia.org/wikipedia/commons/2/2d/Snake_River_%285mb%29.jpg";
var downloadSize = 5245329; //bytes
var oProgress = document.getElementById("speed");
function ShowProgressMessage(msg) {
if (console) {
if (typeof msg == "string") {
console.log(msg);
} else {
@subfuzion
subfuzion / curl.md
Last active July 16, 2024 16:18
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@hsleonis
hsleonis / better-font-smoothing.css
Last active June 13, 2024 18:26
Better font smoothing in cross browser
html {
/* Adjust font size */
font-size: 100%;
-webkit-text-size-adjust: 100%;
/* Font varient */
font-variant-ligatures: none;
-webkit-font-variant-ligatures: none;
/* Smoothing */
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
@cletusw
cletusw / .eslintrc
Last active February 29, 2024 20:24
ESLint Reset - A starter .eslintrc file that resets all rules to off and includes a description of what each rule does. From here, enable the rules that you care about by changing the 0 to a 1 or 2. 1 means warning (will not affect exit code) and 2 means error (will affect exit code).
{
// http://eslint.org/docs/rules/
"ecmaFeatures": {
"binaryLiterals": false, // enable binary literals
"blockBindings": false, // enable let and const (aka block bindings)
"defaultParams": false, // enable default function parameters
"forOf": false, // enable for-of loops
"generators": false, // enable generators
"objectLiteralComputedProperties": false, // enable computed object literal property names
@aFarkas
aFarkas / sssl.js
Created April 22, 2011 10:18
simple, small script loader
/*!
* SSSL: smallest, simpelst script loader
* version: 1.0.1
*
* API:
* Normal usage
* sssl(source [,complete]);
*
* Example:
* sssl('jquery.js', function(){
@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh