Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lencioni
lencioni / waitUntilSettled.ts
Last active October 20, 2023 14:43
cy.waitUntilSettled()
/**
* We often run into a problem with functions that select DOM nodes like
* `cy.get`, where in between the `cy.get` call and the next item in the chain,
* the DOM element that `cy.get` found ends up being removed from the DOM. This
* can affect code as simple as:
*
* cy.get('button').click();
*
* When it fails sporadically, it uses the following error message:
*
@tduarte
tduarte / publish-ghpages.md
Last active March 15, 2024 05:45
If you need to force push an subtree
git checkout master # you can avoid this line if you are in master...
git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
git branch -D gh-pages # delete the local gh-pages because you will need it: ref
@loic-moriame
loic-moriame / index.js
Created July 24, 2015 09:23
node.js + sequelize + sqlite
'use strict';
var Sequelize = require('sequelize');
var sequelize = new Sequelize('mainDB', null, null, {
dialect: "sqlite",
storage: './test.sqlite',
});
sequelize
@rlabbe
rlabbe / real_time_plotting.py
Last active March 14, 2023 13:09
Plot with matplotlib with real time updates without plt.pause
# draw the figure so the animations will work
import matplotlib.pyplot as plt
fig = plt.gcf()
fig.show()
fig.canvas.draw()
while True:
# compute something
plt.plot([1, 2, 3, 4, 5], [2, 1, 2, 1, 2]) # plot something
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 23, 2024 15:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname