Skip to content

Instantly share code, notes, and snippets.

View bibinmjose's full-sized avatar
😁
...

Bibin Jose bibinmjose

😁
...
View GitHub Profile
@alimanfoo
alimanfoo / find_runs.py
Created November 5, 2017 23:53
Find runs of consecutive items in a numpy array.
import numpy as np
def find_runs(x):
"""Find runs of consecutive items in an array."""
# ensure array
x = np.asanyarray(x)
if x.ndim != 1:
raise ValueError('only 1D array supported')
@zhiyzuo
zhiyzuo / Install-Rattle-on-macOS.md
Last active May 17, 2020 12:17
A brief note on how to install rattle/RGtk2 on macOS
@laptrinhcomvn
laptrinhcomvn / Sublime Text 3 cheating.md
Last active November 17, 2023 06:53
Sublime Text 3 patching

Ref: https://gist.github.com/vertexclique/9839383

Important Note

Please use built-in Terminal.app (of Mac OS X) to type and rune the command, do not use another tool (like iTerm2).

Common step after enter run the patch command:

  • After run the commands, start new Sublime Text app, go to Main Menu > Help > Enter License. On the popup type in any text (example "a") and click Use Licence .
@wesleyit
wesleyit / crontab_header.sh
Created September 26, 2014 20:03
A default crontab header that will make the life easier for those who don't remember cron fields or keywords.
## CRONTAB HINTS AND TIPS
##
##
## Entry Description Equivalent To
## @yearly (or @annually) Run once a year at midnight in the morning of January 1 0 0 1 1 *
## @monthly Run once a month at midnight in the morning of the first of the month 0 0 1 * *
## @weekly Run once a week at midnight in the morning of Sunday 0 0 * * 0
## @daily Run once a day at midnight 0 0 * * *
## @hourly Run once an hour at the beginning of the hour 0 * * * *
## @reboot Run at startup @reboot
@jamiees2
jamiees2 / astar.py
Created May 7, 2013 11:20
A* Algorithm implementation in python.
# Enter your code here. Read input from STDIN. Print output to STDOUT
class Node:
def __init__(self,value,point):
self.value = value
self.point = point
self.parent = None
self.H = 0
self.G = 0
def move_cost(self,other):
return 0 if self.value == '.' else 1
@vjt
vjt / copy-from-time-machine.sh
Last active March 8, 2024 17:05
Copy data from a Time Machine volume mounted on a Linux box.
#!/bin/bash
#
# Copy data from a Time Machine volume mounted on a Linux box.
#
# Usage: copy-from-time-machine.sh <source> <target>
#
# source: the source directory inside a time machine backup
# target: the target directory in which to copy the reconstructed
# directory trees. Created if it does not exists.
#