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
<!DOCTYPE html> | |
<html> | |
<head> | |
<base href='http://courseware.codeschool.com/ember/' /> | |
<link href='bootstrap.css' rel='stylesheet' /> | |
<link href='application.css' rel='stylesheet' /> | |
<script src='jquery.js'></script> | |
<script src='handlebars.js'></script> | |
<script src='ember.js'></script> | |
<script src='ember-data.js'></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
var App = Ember.Application.create({ | |
LOG_TRANSITIONS: true | |
}); | |
App.Router.map(function() { | |
this.route('credits', { path: '/thanks' }); | |
this.resource('products', function() { | |
this.resource('product', { path: '/:product_id' }); | |
}); | |
this.resource('contacts', function() { | |
this.resource('contact', { path: '/:contact_id' }); |
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 ldap = require('ldapjs'); | |
var client = ldap.createClient({ | |
url: 'ldap://XXX.XXX.XXX' | |
}); | |
client.bind('XXX@XXX', 'XXX', function (err) { | |
if (err) { | |
console.log(err); | |
} else { |
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
heights = [180, 190, 160, 200] | |
names = [:Losikhin, :Knyazev, :Komlev, :Khodyrev] | |
hIndex = heights.index(heights.max) | |
puts names[hIndex] |
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
#include <iostream> | |
#include <vector> | |
#include <map> | |
int main (void) { | |
int arr[] = {1, 2, 3, 4, 5, 4, 3, 2, 2, 1, 1, 2, 2, 2}; | |
std::vector<int> source (arr, arr + sizeof(arr) / sizeof(arr[0])); | |
std::map<int, int> result; | |
std::map<int, int>::iterator iter; |
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
float[] segment() { | |
float min = 0.0f; | |
float max = 0.0f; | |
float num = 0.0f; | |
do { | |
cin >> num; | |
if (num > max) max = num; | |
if (num < min) min = num; | |
} while (abs(num) > FLT_EPSILON); | |
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
angular | |
.module('app') | |
.factory('staffFactory', [ | |
'$http', 'staffUrl', | |
($http, staffUrl) -> | |
class getStaff | |
constructor: () -> | |
$http | |
.jsonp(staffUrl + '?callback=JSON_CALLBACK') | |
.then(success) |
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
#include <stdio.h> | |
#include <math.h> | |
#include <conio.h> | |
#define PI 3.1415926 | |
double mysin(double n) | |
{ | |
if (n >= 0) { | |
while (n >= 1) { |
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
atom |
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
#include "parser.h" | |
char* substring(char *src, int start, int length) { | |
char* res = (char *)malloc(sizeof(char) * (length + 1)); | |
if (res == NULL) | |
{ | |
return NULL; | |
} | |
memcpy(res, src + start, length); |
OlderNewer