Skip to content

Instantly share code, notes, and snippets.

View slitayem's full-sized avatar
📈

Saloua Litayem slitayem

📈
View GitHub Profile
@slitayem
slitayem / jupyter_shortcuts.md
Created May 27, 2017 07:55 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
@slitayem
slitayem / Python3 Virtualenv Setup.md
Created May 26, 2017 09:23 — forked from pandafulmanda/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3
@slitayem
slitayem / Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Created May 26, 2017 09:20 — forked from IamAdiSri/Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Setting up and using Python3, Pip3, Virtualenv (for Python3) and Virtualenvwrapper (for Python3)
First install pip for Python2. Download the get-pip.py file from https://bootstrap.pypa.io/get-pip.py
$ cd <download location>
$ sudo -H ./get-pip.py
Use pip to install pip3
$ sudo -H pip install pip3
Installing pip3 also installs Python3
To run Python3
$ python3
@slitayem
slitayem / mongodbcheats.js
Created February 28, 2017 18:09 — forked from kgorman/mongodbcheats.js
MongoDB cheat sheet
/* MongoDB cheat sheet */
// replication lag via serverStatus()
db._adminCommand( { serverStatus : 1 , repl ; 2 } )
// stats
db.stats()
db.foo.stats()
// size of BSON of some query
@slitayem
slitayem / Mongodb_cheat_sheet.md
Last active March 19, 2018 06:52
Mongodb 3.x cheat sheet

Note: Tested on mongodb 3.4.1

Creating Collections, Documents, Indexes

See: MongoDB CRUD Operations

Command Description
db.createCollection("movies") Explicitly create a collection
@slitayem
slitayem / mongodb.md
Created February 26, 2017 22:46
#mongodb cheat sheet

MongoDB cheat sheet

Overview

Overview

MongoDB is a document database that provides high performance, high availability, and easy scalability.

  • Document Database
@slitayem
slitayem / sql-mongo_comparison.md
Created February 26, 2017 16:40 — forked from aponxi/sql-mongo_comparison.md
MongoDb Cheat Sheets

SQL to MongoDB Mapping Chart

SQL to MongoDB Mapping Chart

In addition to the charts that follow, you might want to consider the Frequently Asked Questions section for a selection of common questions about MongoDB.

Executables

The following table presents the MySQL/Oracle executables and the corresponding MongoDB executables.

@slitayem
slitayem / install_cassandra.md
Last active February 14, 2017 15:16
Install Cassandra 3.9 on Mac OS X Sierra

Note: This was tested on macOS Sierra Pre-installed

Install cql & cassandra-driver

pip install cql
@slitayem
slitayem / bobp-python.md
Created February 11, 2017 21:14 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@slitayem
slitayem / populate_table_random_data.sql
Last active January 26, 2017 15:40
[Postgresql] Test array update efficiency
CREATE OR REPLACE FUNCTION random_int_array(dim integer, min integer, max integer) RETURNS integer[] AS $BODY$
begin
return (select array_agg(round(random() * (max - min)) + min) from generate_series (0, dim));
end
$BODY$ LANGUAGE plpgsql;
CREATE EXTENSION pgcrypto;
CREATE TABLE test_table as select id, md5(random()::text) || id as name, random_int_array(500000, 100, 10000) as arr, gen_random_uuid() uid from generate_Series(1,3) id
;