Skip to content

Instantly share code, notes, and snippets.

View willi-dev's full-sized avatar

willi-dev willi-dev

View GitHub Profile
@MahdiKarimipour
MahdiKarimipour / spa-react-google-maps-with-polygons-component.jsx
Created July 7, 2021 08:43
Google Maps React Component with Polygons
import React from "react";
import {
GoogleMap,
Polygon,
withScriptjs,
withGoogleMap,
TrafficLayer,
} from "react-google-maps";
import MarkerWithLabel from 'react-google-maps/lib/components/addons/MarkerWithLabel';
import compose from "recompose/compose";
@devhammed
devhammed / countries.json
Last active October 20, 2025 10:42
Countries with Name, Dial Code, Emoji Flag and ISO Code
[
{
"name": "Afghanistan",
"flag": "🇦🇫",
"code": "AF",
"dial_code": "+93"
},
{
"name": "Åland Islands",
"flag": "🇦🇽",
@agmm
agmm / nextjs-file-upload-api.js
Created January 31, 2020 23:03
Simple Nextjs File Upload — Backend API
// Backend
import formidable from 'formidable';
export const config = {
api: {
bodyParser: false,
},
};
export default async (req, res) => {
@Rich-Harris
Rich-Harris / what-is-svelte.md
Last active October 2, 2025 17:25
The truth about Svelte

I've been deceiving you all. I had you believe that Svelte was a UI framework — unlike React and Vue etc, because it shifts work out of the client and into the compiler, but a framework nonetheless.

But that's not exactly accurate. In my defense, I didn't realise it myself until very recently. But with Svelte 3 around the corner, it's time to come clean about what Svelte really is.

Svelte is a language.

Specifically, Svelte is an attempt to answer a question that many people have asked, and a few have answered: what would it look like if we had a language for describing reactive user interfaces?

A few projects that have answered this question:

@exAspArk
exAspArk / curl.sh
Last active October 18, 2025 13:48
Test CORS with cURL
curl -I -X OPTIONS \
-H "Origin: http://EXAMPLE.COM" \
-H 'Access-Control-Request-Method: GET' \
http://EXAMPLE.COM/SOMETHING 2>&1 | grep 'Access-Control-Allow-Origin'
import React, { Component } from 'react';
import { graphql } from 'react-apollo';
import { gql } from 'graphql-tools';
const QUERY = gql`
query MatchesByDate($date: Int) {
matches(date: $date) {
id
minute
period
@ozh
ozh / git cherry-pick within a pull request.md
Last active June 6, 2025 20:27
git cherry-pick within a pull request

1. Create new branch:

git checkout -b otherrepo-master master

2. Get the contents of the PR

git pull https://github.com/otherrepo/my-repo-name.git master
@takien
takien / youtubeID.js
Last active August 15, 2025 06:28
Get YouTube ID from various YouTube URL using JavaScript
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function YouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);