Skip to content

Instantly share code, notes, and snippets.

@kidpixo
kidpixo / jupyter_shortcuts.md
Last active April 7, 2024 12:18
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Warning This is SEVERELY outdated, the current jupyter version is > 6.X, please refer to your current jupyter notebook installation!

Disclaimer : I just copied those shortcuts from Jupyter Menú > Help > Keyboard Shortcuts, I didn't wrote them myself.

Check your current shortcuts in your Help, shortcuts coule have been modified by extensions or your past self.

Toc

Keyboard shortcuts

@cristobal
cristobal / machine-diskutil.sh
Last active February 27, 2024 23:36
Machine Diskutil to mount/unmont external volumes inside docker machines running on Virtualbox
#!/usr/bin/env sh
# @see http://stackoverflow.com/questions/30040708/how-to-mount-local-volumes-in-docker-machine
# @see https://github.com/boot2docker/boot2docker/blob/master/doc/FAQ.md
################################################################################
# Dependency Section #
# #
################################################################################
check_deps() {
## Make sure commands are available
@abyx
abyx / angular-error-handling.js
Last active February 4, 2022 19:19
AngularJS HTTP Error Handling Mechanism
var HEADER_NAME = 'MyApp-Handle-Errors-Generically';
var specificallyHandleInProgress = false;
angular.module('myApp').factory('RequestsErrorHandler', ['$q', function($q) {
return {
// --- The user's API for claiming responsiblity for requests ---
specificallyHandled: function(specificallyHandledBlock) {
specificallyHandleInProgress = true;
try {
return specificallyHandledBlock();
@skroah
skroah / gist:9c22697521626c7b388b
Last active May 10, 2021 03:50
Reactive Systems Design

##Reactive System Design Links

#Articles and Papers

@bettysteger
bettysteger / config.js
Last active August 27, 2018 06:24
Angular $httpProvider interceptor to handle requests and also cancels request on state change
/**
* This array is needed for canceling requests when changing the state/route.
* @type {Array}
*/
var currentRequests = [];
/**
* Handles route changes.
*/
app.run(['$rootScope', function($rootScope) {
@Swind
Swind / unzip.scala
Last active April 22, 2018 08:09
[Unzip in Scala] #Scala #zip
import java.util.zip.ZipFile
import java.io.FileInputStream
import java.io.FileOutputStream
import scala.collection.JavaConversions._
import java.util.zip.ZipEntry
import java.io.InputStream
import java.io.OutputStream
import java.io.File
class ZipArchive {
@DanielaSfregola
DanielaSfregola / perfomance-script.scala
Last active March 29, 2016 06:09
A quick and dirty experiment to compare the performance of scala immutable collections (Seq, List, Vector) of integers when accessing randomly, appending, prepending an element. See article http://danielasfregola.com/2015/06/15/which-immutable-scala-collection.
import scala.concurrent.duration._
import scala.util.Random
import collection.immutable.Seq
private def prettyPrint(text: String)(duration: Duration): Unit =
println(s"[$text] - ${duration}")
private def ranges(base: Int, n: Int): Seq[Range] = for {
@tinusn
tinusn / Application.java
Last active January 9, 2016 21:05
Play Framework 2.3 - Java - CORS
package controllers;
import play.*;
import play.mvc.*;
public class Application extends Controller {
/*
* Define any extra CORS headers needed for option requests (see http://enable-cors.org/server.html for more info)
*/
@sadache
sadache / gist:d357ced8f6c942bca81a
Last active August 29, 2015 14:02
Faster with much less memory consumption JSON object reader
def objectReader[T1,T2,T3,T4,R](t1: String, t2: String, t3: String, t4: String)(f: (T1,T2,T3,T4) => R)(implicit readsT1:Reads[T1], readsT2:Reads[T2], readsT3:Reads[T3], readsT4:Reads[T4]): Reads[R] = {
def orElse[A](a:A, default: =>A) = if(a!=null) a else default
Reads[R]{
case JsObject(fields) =>
var t1V:JsResult[T1] = null.asInstanceOf[JsResult[T1]]
var t2V:JsResult[T2] = null.asInstanceOf[JsResult[T2]]