Skip to content

Instantly share code, notes, and snippets.

View cyberplanner's full-sized avatar

Sal Abuewilly cyberplanner

  • London
View GitHub Profile
@cyberplanner
cyberplanner / Subject under test
Created May 30, 2022 23:10 — forked from mauricedb/Subject under test
Testing stateful React hooks
import { useState } from 'react';
export function useCounter(initial = 0) {
const [count, setCount] = useState(initial);
return [count, () => setCount(count + 1)];
}
@cyberplanner
cyberplanner / add_python_to_WINDOWS_WSL_ubuntu.md
Created February 10, 2022 18:36 — forked from monkut/add_python_to_WINDOWS_WSL_ubuntu.md
Add python to Windows Subsystem for Linux (WSL) [ubuntu]
@cyberplanner
cyberplanner / docker-help.md
Created October 5, 2020 00:20 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@cyberplanner
cyberplanner / facebook_warning.html
Created April 27, 2019 15:29 — forked from tosbourn/facebook_warning.html
How to recreate Facebook's console warning
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<script type="text/javascript">
const warningTitleCSS = 'color:red; font-size:60px; font-weight: bold; -webkit-text-stroke: 1px black;';
const warningDescCSS = 'font-size: 18px;';
@cyberplanner
cyberplanner / Notes.md
Created October 22, 2017 17:07
Node js notes

Notes:

Exporting:

Exporting functions:

// in module.js
exports.randomNum = fucntion() {
  return Math.random();
}
@cyberplanner
cyberplanner / css3-radial-progress-bar.markdown
Created September 27, 2017 10:16
CSS3 Radial Progress Bar
@cyberplanner
cyberplanner / index.html
Created September 22, 2017 14:33
Liquid Radio Button using SVG and GSAP (GreenSock)
<svg viewBox="0 0 800 600" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<filter id="goo">
<feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur"></feGaussianBlur><feColorMatrix in="blur" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -7" result="goo"></feColorMatrix>
<feBlend in="SourceGraphic" in2="goo"></feBlend>
</filter>
<linearGradient x1="0%" y1="0%" x2="100%" y2="100%" id="linearGradient-1">
<stop stop-color="#C25068" offset="0%"></stop>
<stop stop-color="#9E3B5C" offset="100%"></stop>
</linearGradient>
@cyberplanner
cyberplanner / Delete_git_branches.md
Created September 6, 2017 08:34
Delete git branches

Executive Summary

$ git push -d origin <branch_name>
$ git branch -d <branch_name>

Delete Local Branch

To delete the local branch use:

$ git branch -d branch_name
@cyberplanner
cyberplanner / create-react-app-on-heroku.sh
Created July 2, 2017 01:42 — forked from mars/create-react-app-on-heroku.sh
Create a React app & deploy to Heroku
## Global install of the app generator
npm install -g create-react-app
## Setup the app (first-time only)
create-react-app my-app
cd my-app
git init
# Create the Heroku app; requires free account at https://www.heroku.com/
heroku create -b https://github.com/heroku/heroku-buildpack-static.git
@cyberplanner
cyberplanner / fetch.js
Last active June 29, 2017 15:13 — forked from achavez/gist:9767499
Post to Slack using javascript
// https://googlechrome.github.io/samples/fetch-api/fetch-post.html
var request = new Request('https://hooks.slack.com/services/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', {
method: 'POST',
body: JSON.stringify({text: 'Hello'}),
headers: new Headers({'Content-type': 'application/json'})
});
fetch(request).then(function(response) { console.log(response)});