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
Steps: | |
Create new ember project- "ember new todo" | |
Add adapter to project - "ember g adapter application" | |
Add model to project - "ember g model todo task:string completed:boolean" | |
Add route to project - "ember g route todo" | |
Sub Steps: | |
Create fixtures for model: | |
import DS from 'ember-data'; | |
let Todo = DS.Model.extend({ |
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
if view == 'student_details': | |
reg_no = self.request.get('regno',None) | |
period = self.request.get('period',None) | |
#Verify Email address and registration number | |
email = users.get_current_user().email() | |
if ops.verifyUser(email, reg_no) or ops.isSuperAdmin(users.get_current_user().email()): | |
pass | |
else: | |
self.redirect('/unauthorized') |
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 python | |
# encoding: utf-8 | |
""" | |
server.py | |
Created by John Wesonga on 2011-12-12. | |
Copyright (c) 2011 __MyCompanyName__. All rights reserved. | |
""" | |
import tornado.auth |
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
/** | |
* | |
* | |
* AppDispatcher | |
**/ | |
var Dispatcher = require('flux').Dispatcher; | |
var copyProperties = require('react/lib/copyProperties'); | |
var AppDispatcher = copyProperties(new Dispatcher(), { |
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
# globals | |
from fabric.api import env, local, run, sudo, put, cd, runs_once, prompt, require, settings | |
from fabric.contrib.files import exists, upload_template | |
from fabric.contrib.console import confirm | |
from fabric.context_managers import hide | |
env.project_name = 'project_name' | |
env.project_domain = 'mydomain.co.ke' # Project domain | |
# environments |
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
package main | |
import ( | |
gs "camlistore.org/pkg/googlestorage" | |
"code.google.com/p/goauth2/oauth" | |
"fmt" | |
"log" | |
) | |
const ( |
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
function copyData() { | |
var mySheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet(); | |
var range = mySheet.getDataRange(); | |
var firstNameCell = mySheet.getRange('A1'); | |
var lastNameCell = mySheet.getRange('B1'); | |
var row = 1; | |
//skip the header column | |
var dataRange = range.offset(1, 0, range.getNumRows()-1).getValues(); | |
for (i = 0; i < dataRange.length; i++){ |
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
package main | |
import "fmt" | |
//O(n^2) time | |
func RemoveDuplicates(data []string) []string { | |
length := len(data) - 1 | |
for i := 0; i < length; i++ { | |
for j := i + 1; j <= length; j++ { | |
if data[i] == data[j] { |
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
// components/ui/add_profile.js | |
define(function (require) { | |
'use strict'; | |
/** | |
* Module dependencies | |
*/ | |
var defineComponent = require('flight/lib/component'); |
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
package main | |
import ( | |
"encoding/csv" | |
"fmt" | |
_ "io" | |
"os" | |
) | |
func checkCsv() { |