Skip to content

Instantly share code, notes, and snippets.

Hozefa hozefaj

Block or report user

Report or block hozefaj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@hozefaj
hozefaj / checkbox.css
Last active Feb 22, 2019
custom style checkboxes
View checkbox.css
// hide the native checkbox
input[type="checkbox"] {
position: absolute;
opacity: 0;
}
input[type="checkbox"] + label {
display: block;
position: relative;
padding-left: 2rem;
@hozefaj
hozefaj / delaybundle.js
Last active Jan 20, 2019
delay loading for react bundle
View delaybundle.js
// defer loading of non-essential JS until DOM loaded event
function() {
window.addEventListener("load", function() {
var s, t;
s = document.createElement("script");
s.type = "text/javascript";
s.src =
"https://www.paypalobjects.com/digitalassets/c/website/marketing/global/kui/js/opinionLab-2.1.0.js";
t = document.getElementsByTagName("body")[0];
t.appendChild(s);
@hozefaj
hozefaj / delayImage.js
Last active Jan 20, 2019
defer loading image
View delayImage.js
export default class Hero extends React.Component {
state = {
showImages: false,
};
componentDidMount() {
// load images when images comes within the viewport once user starts scrolling
const domRect = this.sectionElement && this.sectionElement.getBoundingClientRect();
if (domRect && window.innerHeight - domRect.top >= 0) {
this.enableImages();
@hozefaj
hozefaj / toggle.js
Created Jan 18, 2019
toggle github PR review files
View toggle.js
[...document.querySelectorAll('.js-details-target')].forEach(button => button.click());
@hozefaj
hozefaj / emoji.md
Last active Oct 25, 2018 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View emoji.md

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@hozefaj
hozefaj / config.json
Created Apr 26, 2018 — forked from anonymous/config.json
Bootstrap Customizer Config
View config.json
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
@hozefaj
hozefaj / .eslintrc
Created Sep 7, 2017
eslintrc to be used on projects
View .eslintrc
// copied from https://github.com/Remchi/bookworm-react/blob/master/.eslintrc
// npm install --save-dev eslint prettier eslint-config-airbnb@^15.0.1 eslint-config-prettier eslint-plugin-prettier eslint-plugin-react eslint-plugin-import eslint-plugin-jsx-a11y@^5.1.1
{
"extends": ["airbnb", "prettier", "prettier/react"],
"plugins": ["prettier"],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2016,
"sourceType": "module",
@hozefaj
hozefaj / states_hash.json
Created Aug 15, 2017 — forked from mshafrir/states_hash.json
US states in JSON form
View states_hash.json
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
View countUp.react.js
var CountdownTimer = React.createClass({
getInitialState: function() {
const date = new Date();
return {
min: date.getMinutes()
};
},
tick: function() {
this.setState({min: this.state.min + 1});
@hozefaj
hozefaj / utils.js
Last active Aug 16, 2017
JS code to show passwords field values when filling forms
View utils.js
// change passwords fields into text on a web page
const nodeList = document.getElementsByTagName("input");
[...nodeList].forEach(node => {
if(node.getAttribute("type") === "password"){
node.setAttribute('type', 'text');
}
});
// wrap code within github to multiple lines
// this helps to prevent horizontal scroll
You can’t perform that action at this time.