Skip to content

Instantly share code, notes, and snippets.

View rtpg's full-sized avatar
:shipit:
Investigating some magic

Raphael Gaschignard rtpg

:shipit:
Investigating some magic
View GitHub Profile
@rtpg
rtpg / pymongo.py
Created April 17, 2016 13:52
pymongo Cheatsheet
db = MongoClient('localhost', 27017).some_db # some_db is the DB name
db.table_name.insert_one({ # table name
'key1': value1,
'key2': value2
})
db.table_name.update_many({'key1':'some_value'}, # update all elts with key1 == 'some_value', setting key2 to 'processed'
{'$set': {'key2': 'processed'})
/*
* photon.cpp
* photonSplit
*
* Created by Diane Nguyen on 4/25/13.
* Copyright 2013 __MyCompanyName__. All rights reserved.
*
*/
#include "photon.h"
#include <cstdlib>
@rtpg
rtpg / work.sh
Created August 28, 2012 12:46
Run this when trying to get something done
#! /bin/bash
# Push a message on-screen every 60 seconds to remind you of what you're supposed to be doing
# requires lib-notify (most distros have it I think)
while [ 1 ]; do
notify-send Hey "Get back to work"
sleep 60;
done