Skip to content

Instantly share code, notes, and snippets.

@archerImagine
archerImagine / Lecture12.py
Created February 2, 2015 16:07
[MIT OCW]: 6.00sc
import datetime
class Person(object):
def __init__(self, name):
#Create a person with name
self.name = name
try:
firstBlank = name.rindex(' ')
# print "__init__: firstBlank: ", firstBlank
self.lastName = name[firstBlank+1:]
@archerImagine
archerImagine / sublime
Last active August 29, 2015 14:14
sublime key combination.
* delete a line in sublime
ctrl + shift + k
@archerImagine
archerImagine / youtubeLoop
Created January 22, 2015 17:13
AutoLoopYoutube
javascript:(function(){
function replaceAll(find, replace, str) {
return str.replace(new RegExp(find, 'g'), replace);
}
constantURL = "https://www.youtube.com/v/VIDEO_ID?version=3&loop=1&playlist=VIDEO_ID&autoplay=1";
myURL = window.location.href;
constantURL = replaceAll("VIDEO_ID",myURL.split("v=")[1],constantURL);
window.location = constantURL
})();
@archerImagine
archerImagine / ubuntuCommands
Created December 27, 2014 17:31
Ubuntu Commands:
1. Disable guest login in ubuntu:-
1. edit `sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf`
2. `allow-guest=false`
@archerImagine
archerImagine / gist:a65524a74763cfcd04bf
Created December 24, 2014 09:54
sublimeJedi AutoCompletion.
"settings":{
"python_interpreter_path": "/usr/bin/python",
"python_package_paths": [
"/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python"
]
}
@archerImagine
archerImagine / ReadMe.md
Created October 15, 2014 19:02
Usefull Linux Command

#How can I recursively copy files by file extension, preserving directory structure? find . -name '*.pdf' | cpio -pdm pdf/

@archerImagine
archerImagine / myLocalBookmarklet
Created August 6, 2014 15:55
Bookmarklet code to get the Current webpage's URL and TITLE, and then redirect to a localhost webpage to store both.
javascript:(function(){
var myHref=window.location.href;
var myTitle = document.title;
window.location = "http://localhost:8080/myTutorials/linksSavedtoLocalFile/" +"#"+myHref+"#"+myTitle;
})();

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after