Skip to content

Instantly share code, notes, and snippets.

View dhandeo's full-sized avatar

Dhanannjay (D'jay) Deo dhandeo

View GitHub Profile
@dhandeo
dhandeo / gist:6cbbebf9aa623fbb9dc7
Last active August 29, 2015 14:18
Sublime Text 3 user configuration
{
"font_size": 14,
"ignored_packages":
[
"Vintage",
"RestructuredText"
],
"pep8_ignore":
[
"E501"

Copy and paste within tmux

  1. enter copy mode using Control+b [
  2. navigate to beginning of text, you want to select and hit Control+Space
  3. move around using arrow keys to select region
  4. when you reach end of region simply hit Alt+w to copy the region
  5. now Control+b ] will paste the selection
@dhandeo
dhandeo / Key Bindings - User.py
Last active August 29, 2015 14:15
Sublime configuration notes / snippets
[
// Refresh folder list with F5
{ "keys": ["f5"], "command": "refresh_folder_list" }
]
@dhandeo
dhandeo / score_2048.py
Created August 29, 2014 14:43
How much score is expected for in 2048 for given highest tile on board, and probability of 4 popping up instead of 2
import sys
import random
# import argparse
def score_2048(highest_tile, probability_of_four = 0.2, verbose=False):
if verbose:
print "Input: ", highest_tile
if highest_tile == 4:
if random.random() <= probability_of_four:
@dhandeo
dhandeo / CTestTestfile.cmake
Created February 8, 2013 18:41
Using python "unittest" with CTest CDash for testing web application written in "Flask". Some tests internally use browser automation using "selenium". Where the first line in the CTestTestfile uses another python function "list_tests.py" to discover all the unit tests starting current directory using unittest discover capability.
# Extract the test by running python code
execute_process(COMMAND "python" "list_tests.py" OUTPUT_VARIABLE STR_TESTS
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE)
separate_arguments(TEST_LIST UNIX_COMMAND ${STR_TESTS})
foreach(ATEST ${TEST_LIST})
#message(" +")