Skip to content

Instantly share code, notes, and snippets.

View gbrault's full-sized avatar
🏠
Working from home

Gilbert Brault gbrault

🏠
Working from home
  • Vence
View GitHub Profile
@Lukas238
Lukas238 / Pure JavaScript dynamic scripts loader and callback function.md
Last active December 22, 2021 17:12
Pure JavaScript dynamic scripts loader + callback function

This pure javascript function allows to dynamically include a script and then execute any function by using a callback.

  
/**********************************
*	FUNCTIONS
***********************************/

function loadScript(url, callback){
	var script = document.createElement("script"); 
@p3trus
p3trus / custom.js
Last active September 26, 2019 07:58
Adds a button to the ipython notebook toolbar to hide/show the input code cell. To use it, you have to put the custom.js file in your `.ipython_<profile name>/static/custom/` folder, where *<profile name>* is the ipython profile in use.
$([IPython.events]).on('notebook_loaded.Notebook', function(){
IPython.toolbar.add_buttons_group([
{
'label' : 'toggle input cells',
'icon' : 'icon-refresh',
'callback': function(){$('.input').slideToggle()}
}
]);
});