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 / 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)});
@cyberplanner
cyberplanner / 0_reuse_code.js
Created June 5, 2017 19:55
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
@cyberplanner
cyberplanner / install.sh
Created April 23, 2017 02:42 — forked from qntmpkts/install.sh
Installer for oh-my-zsh on Termux
main() {
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
@cyberplanner
cyberplanner / gist:8253b9d841a9659655fa6e9a961b7596
Created December 24, 2016 12:12 — forked from rainly/gist:1990246
Installing pgAdmin3 from source on linux(mint)
准备:
libxml2 2.6.18 or above from http://www.xmlsoft.org/
libxslt 1.1.x or above from http://www.xmlsoft.org/
先查看当前系统中是否有安装libxml2,libxslt这两个库,如果没有请到下面的网站中去下载安装
# sudo apt-get install libxml2-dev
# sudo apt-get install libxslt1-dev
由于安装pgAdmin3需要wxGTK,所以也要下载wxGTK
wxGTK 2.8.x from http://www.wxwidgets.org/
@cyberplanner
cyberplanner / gist:d35f5313b8cc46e8f603837cf3f323d8
Created September 28, 2016 15:17 — forked from ryansobol/gist:5252653
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.