Skip to content

Instantly share code, notes, and snippets.

View jhonalino's full-sized avatar
🤷‍♂️
just writing javascript

Jhon (kiko) jhonalino

🤷‍♂️
just writing javascript
View GitHub Profile
@shawntabrizi
shawntabrizi / kusama.js
Last active November 7, 2021 09:03
unlocking data on substrate
var { ApiPromise, WsProvider } = require('@polkadot/api');
var { BN_ZERO } = require('@polkadot/util');
async function main() {
const provider = new WsProvider("wss://kusama-rpc.polkadot.io/", false);
provider.connect();
const api = await ApiPromise.create({ provider });
// Get general information about the node we are connected to
const [chain, nodeName, nodeVersion] = await Promise.all([
@shanselman
shanselman / ohmyposhv3-v2.json
Last active April 18, 2024 22:35
ohmyposhv3-v2
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@bradtraversy
bradtraversy / mysql_cheat_sheet.md
Last active April 24, 2024 14:41
MySQL Cheat Sheet

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@bradtraversy
bradtraversy / django_deploy.md
Last active April 4, 2024 11:28
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.

@noelboss
noelboss / git-deployment.md
Last active April 24, 2024 03:17
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.

@tylertadej
tylertadej / tabTitleSwitcher.js
Created December 2, 2015 22:31
Change page title when browser tab is unfocused
/*
* Usage
* The following code will modify the title of the browser tab on the "blur" event and change it back to the original on the "focus" event.
* http://developers.optimizely.com/javascript/code-samples/index.html#advanced-use-cases-browserTab-test
*/
// store the original tab title
var origTitle = document.title;
// function to change title when focusing on tab
@paulirish
paulirish / what-forces-layout.md
Last active April 24, 2024 12:47
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@danburzo
danburzo / README.md
Last active July 29, 2021 08:41
Get all event listeners on the page in Google Chrome