Skip to content

Instantly share code, notes, and snippets.

View supposedly's full-sized avatar
🤗
man

hadi tarhini supposedly

🤗
man
  • Washington, USA
View GitHub Profile
// Converting Twitter Bootstrap RFS mechanism into typescript to make it available for CSS in JS i.e. (styled components).
// Twitter Bootstrap RFS: https://github.com/twbs/rfs
// Javascript Approach: https://gist.github.com/supposedly/9b9f5de66c2bcbbf5d7469dcec50bfd7
// Usage
// import rfs from 'rfs';
// rfs( '20px', 'font-size' );
// rfs( '1.5rem', 'font-size' );
// rfs( '1rem', 'margin-bottom' );
@jcubic
jcubic / cdn.md
Last active May 8, 2024 15:04
How to setup a literally free CDN
-- A note about faking toruses:
-- Spheres under projection become circles.
-- If we treat a torus like a chain of overlapping spheres, then we can draw
-- it using just circfill :)
::_::
cls(1)
-- The camera rotation angle.
q=t()/6
@mouse-reeve
mouse-reeve / fizzbuzz.py
Last active April 22, 2022 06:33
Fizzbuzz via answers.com
''' we're solving fizzbuzz with a little help from the web '''
from html.parser import HTMLParser
from urllib.request import Request, urlopen
import re
import time
base_url = 'https://www.answers.com/Q/'
tag_name = 'div'
class_name = 'answer-body'
delimiter = '_'
@pandauxstudio
pandauxstudio / hide-scrollbar-mixin.scss
Last active December 21, 2022 15:31
Sass mixin to hide scrollbar in Chrome, Firefox, Safari and IE.
@mixin hideScrollbar {
// https://blogs.msdn.microsoft.com/kurlak/2013/11/03/hiding-vertical-scrollbars-with-pure-css-in-chrome-ie-6-firefox-opera-and-safari/
// There is a CSS rule that can hide scrollbars in Webkit-based browsers (Chrome and Safari).
&::-webkit-scrollbar {
width: 0 !important
}
// There is a CSS rule that can hide scrollbars in IE 10+.
-ms-overflow-style: none;
// Use -ms-autohiding-scrollbar if you wish to display on hover.
@zbeekman
zbeekman / GH-CF-strict-SSL-w-CDN.md
Last active March 8, 2024 18:12
Setting up GH-pages with custom domain, strict (end-to-end) SSL with CloudFlare DNS & CDN

Custom domains, GH-pages, Cloudflare and strict SSL end-to-end encryption

Why I wrote this

Before Github supported SSL encryption for github pages sites, many people were using CloudFlare (CF) as their DNS provider and CDN proxy. CF allowed users to enable SSL encryption from the CDN end points/proxies to the end user. This was great and it allowed visitors to your website to connect with a secure connection between their browser and the cloudflare CDN box that was serving your content. However, with this setup one (significant) link in the chain remained unencrypted and

@AgentRev
AgentRev / fuck_win10_reboot.bat
Last active March 17, 2020 04:47
Shut the fuck up you stupid fucking Windows Update reboot shitfuck - run as admin
rem KILL WINDOWS UPDATE REBOOT WITH FIRE!!!
SET mwuo=Microsoft\Windows\UpdateOrchestrator
schtasks /End /TN "\%mwuo%\Reboot"
schtasks /End /TN "\%mwuo%\USO_UxBroker_Display"
schtasks /End /TN "\%mwuo%\USO_UxBroker_ReadyToReboot"
schtasks /Change /TN "\%mwuo%\Reboot" /DISABLE
schtasks /Change /TN "\%mwuo%\USO_UxBroker_Display" /DISABLE
schtasks /Change /TN "\%mwuo%\USO_UxBroker_ReadyToReboot" /DISABLE
icacls "%WINDIR%\System32\Tasks\%mwuo%\Reboot" /deny "*S-1-1-0:F"
icacls "%WINDIR%\System32\Tasks\%mwuo%\USO_UxBroker_Display" /deny "*S-1-1-0:F"
@zmwangx
zmwangx / No longer able to make public gists secret.md
Last active April 11, 2024 22:22
No longer able to make public gists private — message to GitHub

We've been able to toggle visibility of gists since 2014 (https://github.com/blog/1837-change-the-visibility-of-your-gists), but I just noticed that I can no longer make public gists private. That is, when I edit private gists I still see the "Make Public" button, but not the other way round — there's only a "Delete" button when I edit public gists; the "Make Secret" which should be next to it (as shown in the screencast in the linked blog post) is nowhere to be found. I made a screenshot and a screencast demonstrating the issue, both of which are attached. Could you please confirm this issue? Was this an intentional change, and why? Thank you for your attention.

gist-unable-to-make-secret

![gist-unable-to-make-secret](https://cloud.githubusercontent.com/assets/4149852/16898407/c76db210-4c0b-11e6-9108-0450f1edebb4.gif)
@afternoon
afternoon / rename_js_files.sh
Created February 15, 2014 18:04
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;