Skip to content

Instantly share code, notes, and snippets.

View fehmi's full-sized avatar
🏠
Working from home

Fehmi Özüseven fehmi

🏠
Working from home
View GitHub Profile
@fehmi
fehmi / store.ts
Created August 18, 2023 16:33 — forked from koenbok/store.ts
import * as React from "react";
/**
A hook to simply use state between components
Warning: this only works with function components (like any hook)
Usage:
// You can put this in an central file and import it too
const useStore = createStore({ count: 0 })
@fehmi
fehmi / Google Image Resize Proxy
Created May 17, 2023 17:45 — forked from nblenke/Google Image Resize Proxy
Use Google's Image caching/optimization proxy to resize an image
(function () {
var img = document.createElement('img');
path = encodeURIComponent('https://s3.amazonaws.com/llama0/burningfiremonkey.gif'),
width = 600,
refresh = 2592000;
img.src = 'https://images1-focus-opensocial.googleusercontent.com/gadgets/proxy?url=' + path + '&resize_w=' + width + '&container=focus&refresh=' + refresh;
document.body.appendChild(img);
}());
@fehmi
fehmi / gist:7a8ba8fa5d0fd7aaec595a0cc0c5b58b
Created June 28, 2022 13:04
Leave Your Supermodel Friends at Home
In his book Influence, Robert Cialdini tells the story of two brothers, Sid and Harry, who ran a clothing store in 1930s America. Sid was in charge of sales and Harry led the tailoring department. Whenever Sid noticed that the customers who stood before the mirror really liked their suits, he became a little hard of hearing. He called to his brother: “Harry, how much for this suit?” Harry looked up from his cutting table and shouted back: “For that beautiful cotton suit, forty-two dollars.” (At that time, it was a completely inflated price.) Sid pretended as if he hadn’t understood: “How much?” Harry yelled again: “Forty-two dollars!” Sid then turned to
his customer and reported: “He says twenty-two dollars.” At this point, the customer would have quickly put the money on the table and hastened from the store with the suit before poor Sid noticed his “mistake.”
Maybe you know the following experiment from your school days: Take two buckets. Fill the first with lukewarm water and the second with ice water. Di
@fehmi
fehmi / webkit-pseudo-elements.md
Created May 15, 2020 14:53 — forked from leostratus/webkit-pseudo-elements.md
Webkit Pseudo-Element Selectors (Shadow DOM Elements)

An ongoing project to catalogue all of these sneaky, hidden, bleeding edge selectors as I prepare my JSConf EU 2012 talk.

Everything is broken up by tag, but within each the selectors aren't particularly ordered.

I have not tested/verified all of these. Have I missed some or got it wrong? Let me know. - A

A friendly reminder that you may need to set this property on your target/selected element to get the styling results you want:

-webkit-appearance:none;