Skip to content

Instantly share code, notes, and snippets.

View w3debugger's full-sized avatar
🎯
Focusing

Muhammad Umar w3debugger

🎯
Focusing
View GitHub Profile
@thebuilder
thebuilder / jest.config.js
Last active October 29, 2022 02:42
Use Jest Projects to run both JSDom and Node tests in the same project
module.exports = {
projects: [
{
displayName: 'dom',
testEnvironment: 'jsdom',
snapshotSerializers: ['enzyme-to-json/serializer'],
testMatch: ['**/__tests__/**/*.test.js?(x)']
},
{
displayName: 'node',
@rhostem
rhostem / _document.js
Last active January 2, 2022 07:40
[react, next.js] tags in head for SEO
import Head from 'next/head'
import SEO from '../constants/seo'
export default ({
title = SEO.title,
description = SEO.description,
pageUrl = SEO.siteUrl,
mainImage = SEO.mainImage,
iosApplink = SEO.quizBuzzHomeUrl,
androidAppLink = SEO.quizBuzzHomeUrl,
@Gaafar
Gaafar / git-shove.sh
Last active April 1, 2019 12:05
shove to branch
#!/bin/bash
# install:
# copy this file to /usr/local/bin/shove
# sudo chmod +x /usr/local/bin/shove
# then use: shove alpha
remoteBranch=${1?Please specify origin branch to shove}
localBranch=`git symbolic-ref --short -q HEAD`
read -p "Force push local branch ($localBranch) => (origin/$remoteBranch). Proceed? (y/n) " -r
@peduarte
peduarte / esnextbin.md
Last active August 25, 2022 14:55
Vanilla Debounce
@milosdjakonovic
milosdjakonovic / pattern.js
Created July 28, 2016 18:50
Regex to match media queries and get values
/@\s*?media\s*?\(\s*?(min|max)-(width|height)\s*?:\s*?(\d+)(px|em)\s*?\)\s*?{(.*)}/gms
/**
* Only basically tested.
* Should match min-max-width-height number px|em and following rules.
* Provides capturing groups to determinate condition alongside with css.
*
* Created with help of regex101
* https://regex101.com/r/zA6fX2/1
@learncodeacademy
learncodeacademy / webpack.config.js
Created January 8, 2016 03:55
Sample Basic Webpack Config
var debug = process.env.NODE_ENV !== "production";
var webpack = require('webpack');
module.exports = {
context: __dirname,
devtool: debug ? "inline-sourcemap" : null,
entry: "./js/scripts.js",
output: {
path: __dirname + "/js",
filename: "scripts.min.js"
@mds
mds / dropbox-redirect.html
Created March 5, 2015 16:42
A Simple JS Redirect
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- Replace with your own title -->
<title>Your Project's Title</title>
<script>
// Add your own shareable dropbox link
window.location.replace("https://www.dropbox.com");
</script>
%reset-Button {
border: none;
margin: 0;
padding: 0;
width: auto;
overflow: visible;
background: transparent;
/* inherit font & color from ancestor */
@nmsdvid
nmsdvid / new_gist_file.js
Created February 4, 2014 16:32
Simple JavaScript Debounce Function
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `immediate` is passed, trigger the function on the
// leading edge, instead of the trailing.
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
clearTimeout(timeout);
@philippebarbosa
philippebarbosa / unlike-facebook-page-fast.md
Last active August 24, 2022 01:40
A simple way to unlike all facebook page in one time !

How to unlike all Facebook page at once

If you want to do cleaning on your Facebook timeline, you may want to unlike all Facebook pages quickly. There is a way for that :

  • Go to firefox and install iMacros
  • Open a text editor (i.e. Notepad, Sublime Text), and paste that code inside :
VERSION BUILD=7401110 RECORDER=FX