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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
unicode(object='') -> unicode object | |
unicode(string[, encoding[, errors]]) -> unicode object | |
Create a new Unicode object from the given encoded string. | |
encoding defaults to the current default string encoding. | |
errors can be 'strict', 'replace' or 'ignore' and defaults to 'strict'. |
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
{u'paging': {u'total': 2219, u'next': u'100'}, u'elements': [{u'slug': u'gamification', u'courseType': u'v2.ondemand', u'name': u'Gamification', u'id': u'69Bku0KoEeWZtA4u62x6lQ'}, {u'slug': u'missing-data', u'courseType': u'v2.ondemand', u'name': u'Dealing With Missing Data', u'id': u'0HiU7Oe4EeWTAQ4yevf_oQ'}, {u'slug': u'vital-signs', u'courseType': u'v2.ondemand', u'name': u'Vital Signs: Understanding What the Body Is Telling Us', u'id': u'5zjIsJq-EeW_wArffOXkOw'}, {u'slug': u'modern-art-ideas', u'courseType': u'v2.ondemand', u'name': u'Modern Art & Ideas', u'id': u'v9CQdBkhEeWjrA6seF25aw'}, {u'id': u'QgmoVdT2EeSlhSIACx2EBw', u'slug': u'evolvinguniverse', u'courseType': u'v2.ondemand', u'name': u'The Evolving Universe'}, {u'slug': u'changing-global-order', u'courseType': u'v2.ondemand', u'name': u'The Changing Global Order', u'id': u'vwcoxOyuEeWLaBLI8fdMlw'}, {u'slug': u'design', u'courseType': u'v2.ondemand', u'name': u'Design: Creation of Artifacts in Society', u'id': u'FlptMGk3EeSiViIACw8GlA'}, {u'id': u |
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
{u'paging': {u'total': 2219, u'next': u'100'}, u'elements': [{u'slug': u'gamification', u'courseType': u'v2.ondemand', u'name': u'Gamification', u'id': u'69Bku0KoEeWZtA4u62x6lQ'}, {u'slug': u'missing-data', u'courseType': u'v2.ondemand', u'name': u'Dealing With Missing Data', u'id': u'0HiU7Oe4EeWTAQ4yevf_oQ'}, {u'slug': u'vital-signs', u'courseType': u'v2.ondemand', u'name': u'Vital Signs: Understanding What the Body Is Telling Us', u'id': u'5zjIsJq-EeW_wArffOXkOw'}, {u'slug': u'modern-art-ideas', u'courseType': u'v2.ondemand', u'name': u'Modern Art & Ideas', u'id': u'v9CQdBkhEeWjrA6seF25aw'}, {u'id': u'QgmoVdT2EeSlhSIACx2EBw', u'slug': u'evolvinguniverse', u'courseType': u'v2.ondemand', u'name': u'The Evolving Universe'}, {u'slug': u'changing-global-order', u'courseType': u'v2.ondemand', u'name': u'The Changing Global Order', u'id': u'vwcoxOyuEeWLaBLI8fdMlw'}, {u'slug': u'design', u'courseType': u'v2.ondemand', u'name': u'Design: Creation of Artifacts in Society', u'id': u'FlptMGk3EeSiViIACw8GlA'}, {u'id': u |
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
python | |
Python 2.7.12 (default, Nov 19 2016, 06:48:10) | |
[GCC 5.4.0 20160609] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> import urllib,json | |
>>> url="https://api.coursera.org/api/courses.v1?search&query=python" | |
>>> response = urllib.urlopen(url) | |
>>> data = json.loads(response.read()) | |
>>> print data | |
{u'paging': {u'total': 2219, u'next': u'100'}, u'elements': [{u'slug': u'gamification', u'courseType': u'v2.ondemand', u'name': u'Gamification', u'id': u'69Bku0KoEeWZtA4u62x6lQ'}, {u'slug': u'missing-data', u'courseType': u'v2.ondemand', u'name': u'Dealing With Missing Data', u'id': u'0HiU7Oe4EeWTAQ4yevf_oQ'}, {u'slug': u'vital-signs', u'courseType': u'v2.ondemand', u'name': u'Vital Signs: Understanding What the Body Is Telling Us', u'id': u'5zjIsJq-EeW_wArffOXkOw'}, {u'slug': u'modern-art-ideas', u'courseType': u'v2.ondemand', u'name': u'Modern Art & Ideas', u'id': u'v9CQdBkhEeWjrA6seF25aw'}, {u'id': u'QgmoVdT2EeSlhSIACx2EBw', u'slug': u'evolvinguniverse', u'courseType': u'v2 |
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
""" | |
I want to do something like this: | |
""" | |
class Meta: | |
permissions = ( | |
('view_task', 'View task'), | |
) | |
group = Group.objects.create(name='employees') | |
assign_perm('change_task', group, task) |
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
sudo apt-get install libudev1 | |
cd /lib/x86_64-linux-gnu/ | |
sudo ln -s libudev.so.1 libudev.so.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
@login_required(login_url='/login/') | |
@group_required('client_group') | |
def picture(request): | |
user = request.user | |
profile_pictures = django_settings.MEDIA_ROOT + '/profile_pictures/' | |
if not os.path.exists(profile_pictures): | |
os.makedirs(profile_pictures) | |
if request.method == 'POST': | |
_picture = request.FILES['picture'] | |
filename = profile_pictures + request.user.username + '_' + str(request.user.id) + '.jpg' |
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
========================== | |
Creating target directory... | |
========================== | |
Command start time 2017-12-13 17:02:25 | |
Connection to ajoy.net closed. | |
SSH command execution finished | |
host=ajoy.net, exitcode=0 | |
Command end time 2017-12-13 17:02:30 |
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
{% extends 'dashboard/test.html' %} | |
{% load staticfiles %} | |
{% load i18n %} | |
{% block content %} | |
<!-- page content --> | |
<div class="right_col" role="main"> | |
<div class=""> | |
<div class="page-title"> | |
<div class="title_left"> |
OlderNewer