This file contains hidden or 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 two-space tabs for JavaScript | |
path = require 'path' | |
atom.workspaceView.eachEditorView (editorView) -> | |
editor = editorView.getEditor() | |
filepath = editor.getPath() | |
# set Tab Length for JS sources | |
if path.extname(filepath) is '.js' |
This file contains hidden or 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
#include <iostream> | |
#include <string> | |
#include <iomanip> | |
using namespace std; | |
int main(){ | |
const int FIRST_COL_WIDTH = 20; | |
const int SECOND_COL_WIDTH = 10; |
This file contains hidden or 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
// Takes a year, month, and day number and outputs a string in the format "Dec 05, 2012". | |
// 'month' input parameter starts with zero. | |
function convertDateToEnglishString(day, month, year) { | |
var monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', | |
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; | |
try { | |
var monthName = monthNames[month]; | |
} catch (e) { | |
alert('Invalid date'); | |
return; |
This file contains hidden or 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
from django.db import models | |
class User(models.Model): | |
# Django's auth framework provides its own very | |
# capable user model, but we'll make our own | |
# assuming English/Western-style names – | |
# first name/last name distinction doesn't apply in all cultures | |
first_name = models.CharField(max_length=64) |
This file contains hidden or 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
function prettifyGoogleSheetsJSON(data) { | |
for (var i = 0; i < data.feed.entry.length; i++) { | |
for (var key in data.feed.entry[i]) { | |
if (data.feed.entry[i].hasOwnProperty(key) && key.substr(0,4) === 'gsx$') { | |
// copy the value in the key up a level and delete the original key | |
data.feed.entry[i][key.substr(4)] = data.feed.entry[i][key].$t; | |
delete data.feed.entry[i][key]; | |
} | |
} | |
} |
This file contains hidden or 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
{ | |
"content_item": { | |
"id": 81424633, | |
"create_time": "2014-09-19T23:36:06Z", | |
"last_modified_time": "2014-09-20T22:58:13Z", | |
"expire_time": null, | |
"slug": "la-me-pc-gov-brown-disposes-of-bills-20140919", | |
"title": "Governor disposes of mandating diaper changing stations in men's rooms", | |
"display_time": "2014-09-20T00:02:00Z", | |
"ad_keywords": null, |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<link href="favicon.ico" rel="icon" type="image/x-icon" /> | |
<title>Page title</title> | |
<meta name="description" content="Page description, shows up in search results. Should be no longer than 150-160 characters." /> |
This file contains hidden or 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
hliddiard@ubuntu:~$ npm update -g yo | |
npm http GET https://registry.npmjs.org/yo | |
npm http 304 https://registry.npmjs.org/yo | |
hliddiard@ubuntu:~$ yo --version | |
1.1.2 | |
hliddiard@ubuntu:~$ |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content="{% block meta_description %}Default meta description here.{% endblock %}"> | |
<title>{% block title %}Default title here{% endblock %}</title> | |
<link rel="icon" type="image/x-icon" href="{{ STATIC_URL }}img/favicon.ico"> | |
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}css/main.css"> | |
<script src="//code.jquery.com/jquery-1.10.2.min.js"></script> |
This file contains hidden or 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
(function($) { | |
/*! | |
A very simplified version of: | |
Name: Reading Time | |
Dependencies: jQuery | |
Author: Michael Lynch | |
Author URL: http://michaelynch.com | |
Date Created: August 14, 2013 | |
Date Updated: January 24, 2014 |