Skip to content

Instantly share code, notes, and snippets.

import React, { useState, useEffect } from 'react';
export class GeoService {
public pos: any;
public getPosition() {
navigator.geoLocation.getCurrentPosition((position) => {
this.pos = position;
});
}
How to disable a link using only CSS?
.not-active {
pointer-events: none;
cursor: default;
text-decoration: none;
color: black;
}
<a href="link.html" class="not-active">Link</a>
"use strict";
(function () {
var showHideJobFilter = function () {
if ($(window).width() < 801 && !$('#refine-search-box-inner').hasClass("mobile-active")) {
$('#refine-search-box-inner').addClass('mobile-active').css({ 'display': 'none' });
}
else if ($(window).width() >= 801 && $('#refine-search-box-inner').hasClass("mobile-active")) {
$('#refine-search-box-inner').removeClass('mobile-active').css({ 'display': 'none' });
}
@elizad
elizad / .txt
Created November 8, 2018 10:27
https://github.com/neilkennedy/HackerSharp
https://hackernews.api-docs.io/v0/overview/introduction
https://hackernews.api-docs.io/v0/overview/introduction
"use strict";
(function () {
var theWindow = $(window);
var bg = $('.img-fluid_jsfit');
var aspectRatio = bg.width() / bg.height();
var resizeBg = function () {
// Write your JavaScript code.
// js for google capcha
function onSubmit(token) {
alert('thanks ' + document.getElementById('field-submitcv').value);
}
function validate(event) {
event.preventDefault();
if (!document.getElementById('field-submitcv').value) {
@elizad
elizad / google review
Last active June 4, 2018 12:02
googlerev,js
const app = document.getElementById('root-rev');
const logo = document.createElement('img');
logo.src = '~/../images/app/google logo.png';
logo.className = 'img-fluid';
logo.width = '80';
logo.alt = "Google";
const txt = document.createElement('span');
txt.className = 'pl-1';
@elizad
elizad / js code bits
Last active January 20, 2017 19:34
js code bits
if (elem.offstHeight <500){
divs.forEach(function(elem, index, arr){
elem.style.maxHeight = '100vh';
})
}
@elizad
elizad / 0_reuse_code.js
Created January 7, 2016 10:37
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console