This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
print string.ascii_lowercase | |
print string.ascii_uppercase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#sudo chown username:groupname /opt/lampp/htdocs | |
sudo chown kevin:kevin /opt/lampp/htdocs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add file to /etc/sudoers.d/ folder | |
username ALL=(root) NOPASSWD:/usr/sbin/synaptic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the UUID | |
sudo blkid | |
# Create a mount point | |
sudo mkdir /media/kevin/newvolume | |
# Open /etc/fstab using gksu | |
gksu gedit /etc/fstab | |
#Line to add in /etc/fstab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git remote rm origin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="http://code.jquery.com/jquery.min.js"></script> | |
<script> | |
//All external links open in a new tab | |
$(document.links).filter(function() { | |
return this.hostname != window.location.hostname; | |
}).attr('target', '_blank'); | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
import glob, shutil | |
dst = "/media/kevin/volume/Tutorials/" | |
src = "/home/kevin/Downloads" | |
for file in glob.glob("/home/kevin/Downloads/*.pdf"): | |
shutil.move(file, dst) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# -*- coding: utf-8 -*- | |
pyg = 'ay' | |
while True: | |
original = raw_input('Enter a word: \t') | |
if len(original) > 0 and original.isalpha(): | |
word = original.lower() | |
first = word[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JS Ternary operator example | |
var protocol = document.location.protocol; | |
var prot = (protocol == 'http:' || protocol == 'https:') ? 'remote' : 'local' | |
console.log('You are viewing a ' + prot + ' file via the '+ protocol + ' protocol'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var contain=new Array; | |
for (var current = 2; ; current++) { | |
if (current % 7 == 0) | |
contain[contain.length] = current; | |
//Common gotcha. use two equals signs for comparison | |
if (contain.length == 5) | |
break; | |
} |
OlderNewer