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 countdownRunner = function() { | |
var index; | |
function log(){ | |
console.log(index); | |
} | |
function iterate(){ | |
log(); | |
if(index>1) setTimeout(iterate, 1000); |
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
// Functional Version | |
window.logCar = function(carOptions){ | |
if (carOptions.hasOwnProperty('color') && carOptions.hasOwnProperty('make')) | |
console.log("I'm a " + carOptions.color + " " + carOptions.make); | |
else | |
console.log("I can't tell you about the car!"); | |
} | |
logCar({ color: 'blue', make: 'BMW' }); |
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 convertToArray(iterable) { | |
return Array.prototype.slice.call(iterable); | |
} | |
Function.prototype.cached = function() { | |
var __method = this; | |
// This is to ensure there is only one argument, otherwise just return the results of the calling method. | |
if (__method.length != 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
// 1. | |
function Person(name) { | |
this.name = name; | |
} | |
var thomas = new Person('Thomas'); | |
var amy = new Person('Amy'); | |
console.log(thomas.name); |
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
using System; | |
using System.Linq; | |
using System.Collections.Generic; | |
using Fishidy.Domain.SqlServerStructures.Models.Persistence; | |
using Fishidy.Domain.SqlServerStructures.Models.Processing; | |
namespace Fishidy.Domain.SqlServerStructures.StoredProcedures | |
{ | |
public class Social_GetNotificationCounts | |
{ |
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
#region Public Methods | |
public void Send(NotificationType type, NotificationTemplate template, ObjectId fromUserId, ObjectId toUserId) | |
{ | |
if (type != NotificationType.Email) | |
return; | |
var fromUser = UserService.GetById(fromUserId); | |
var toUser = UserService.GetById(toUserId); | |
var toMailAddress = new MailAddress(toUser.EmailAddress, toUser.Name.FullName); |
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
db.groups.insert({ | |
"_id": ObjectId("4e54ed9f48dc5922c0094a42"), | |
"groupName": "mongoDB User", | |
"persons": [ | |
ObjectId("4e54ed9f48dc5922c0094a43"), | |
ObjectId("4e54ed9f48dc5922c0094a40") | |
] | |
}); | |
db.groups.insert({ |
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
using System; | |
using System.Collections.Generic; | |
using System.Configuration; | |
using System.Linq; | |
using Fishidy.Domain.Attributes; | |
using Fishidy.Domain.Models.Base; | |
using MongoDB.Bson.Serialization; | |
using MongoDB.Bson.Serialization.Conventions; | |
using MongoDB.Driver; |
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 sublime, sublime_plugin | |
import os | |
class DetectFileTypeCommand(sublime_plugin.EventListener): | |
""" Detects current file type if the file's extension isn't conclusive """ | |
""" Modified for Ruby on Rails and Sublime Text 2 """ | |
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
def on_load(self, view): | |
filename = view.file_name() |
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
{ | |
"cmd": ["/usr/local/bin/coffee", "-cp", "--bare", "$file"], | |
"selector": "source.coffee", | |
"path": "/usr/local/bin:$PATH" | |
} |
OlderNewer