Skip to content

Instantly share code, notes, and snippets.

View aykutyaman's full-sized avatar

Aykut Yaman aykutyaman

View GitHub Profile
for( var i = 0; i < 100; i++ ) {
console.log( i );
}
function KnowledgeMapInitGlobals() {
window.KnowledgeMapGlobals = {
colors: {
blue: "#0080C9",
green: "#8EBE4F",
red: "#E35D04",
gray: "#FFFFFF"
},
╰─$ jitsu deploy 1 ↵
info: Welcome to Nodejitsu aykutyaman
info: jitsu v0.12.1, node v0.8.21
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in server.js
WARN unmet dependency /var/www/acaline/server/node_modules/express requires connect@'2.4.2' but will load
WARN unmet dependency /var/www/acaline/server/node_modules/connect,
WARN unmet dependency which is version 2.7.2
WARN unmet dependency /var/www/acaline/server/node_modules/express requires cookie@'0.0.4' but will load
From shell:
redis-cli -h nodejitsudb8654541119.redis.irstack.com -p 6379 -a nodejitsudb8654541119.redis.irstack.com:f327cfe980c971946e80b8e975fbebb4
Could not connect to Redis at nodejitsudb8654541119.redis.irstack.com:6379: Connection refused
not connected>
From the log of nodejitsu:
error Tue, 19 Mar 2013 08:03:17 GMT Error: Redis connection to nodejitsudb8654541119.redis.irstack.com:6379 failed - connect ECONNREFUSED
at RedisClient.on_error (/opt/haibu/apps/aykutyaman/acaline/package/node_modules/redis/index.js:140:24)
at Socket. (/opt/haibu/apps/aykutyaman/acaline/package/node_modules/redis/index.js:74:14)
^CWed Mar 27 20:11:21 Assertion failure isABSONObj() shell/../scripting/../db/../bson/bson-inl.h 184
0x4785ff 0x491ac3 0x493859 0x471c76 0x4728ad 0x7f8903c574a0 0x7f89050a114a 0x49cec3 0x49ced9 0x49eeeb 0x599ad2 0x599f5e 0x4a2969 0x4bb393 0x4bb6b7 0x4cdfb2 0x522a9c 0x5166ec 0x522489 0x4e305a
mongo(_ZN5mongo15printStackTraceERSo+0x1f) [0x4785ff]
mongo(_ZN5mongo12sayDbContextEPKc+0xc3) [0x491ac3]
mongo(_ZN5mongo8assertedEPKcS1_j+0xf9) [0x493859]
mongo(_Z7killOpsv+0x2c6) [0x471c76]
mongo(_Z10quitNicelyi+0x1d) [0x4728ad]
/lib/x86_64-linux-gnu/libc.so.6(+0x364a0) [0x7f8903c574a0]
/lib/x86_64-linux-gnu/libpthread.so.0(recv+0x6a) [0x7f89050a114a]
mongo(_ZN5mongo6Socket5_recvEPci+0x13) [0x49cec3]
@aykutyaman
aykutyaman / gist:5388797
Created April 15, 2013 15:09
backbone validate
Backbone.Validate = function(model, changedAttributes) {
return (function(patterns) {
var isNumeric = function(value){
return _.isNumber(value) ||
(_.isString(value) && value.match(patterns.number));
};
var hasValue = function(value) {
return !(_.isNull(value) || _.isUndefined(value) || (_.isString(value) && value === ''));
@aykutyaman
aykutyaman / gist:5957621
Created July 9, 2013 14:06
jitsu deploy error output
╰─$ jitsu deploy 1 ↵
info: Welcome to Nodejitsu aykutyaman
info: jitsu v0.12.11, node v0.8.21
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in server/server.js
info: Creating snapshot 0.1.1-18
info Uploading: [=============================] 100%
error: Error running command deploy
error: Nodejitsu Error (500): Internal Server Error
curl https://api.efatura.com/ \
...
-d "receiver[name]=Foo" \
-d "receiver[surname]=Bar" \
-d "total=30.08"
...
Template.workspaceBroadcast.workspace = function() {
return Workspaces.findOne(Session.get("selectedWorkspaceId"));
};
Template.workspaceBroadcast.rendered = function() {
console.log('rendered');
};
Template.messages.messages = function(){
return Messages.find({workspaceId: Session.get("selectedWorkspaceId")}, { sort: { submitted: -1 }});
a["{\"msg\":\"added\",\"collection\":\"meteor_autoupdate_clientVersions\",\"id\":\"BHx6NPxiMDaJP84rN\",\"fields\":{\"current\":true}}"]
a["{\"msg\":\"added\",\"collection\":\"roles\",\"id\":\"B2ge3K5n7zbCtdDjj\",\"fields\":{\"name\":\"teacher\"}}"]
a["{\"msg\":\"added\",\"collection\":\"roles\",\"id\":\"Hg9a5ZJY2W45nTK32\",\"fields\":{\"name\":\"root\"}}"]
a["{\"msg\":\"added\",\"collection\":\"meteor_autoupdate_clientVersions\",\"id\":\"version\",\"fields\":{\"version\":\"a5bcf426e9c41894daf2061c9020c3d\"}}"]
a["{\"msg\":\"added\",\"collection\":\"meteor_autoupdate_clientVersions\",\"id\":\"version-cordova\",\"fields\":{\"version\":\"none\",\"refreshable\":false}}"]
a["{\"msg\":\"added\",\"collection\":\"meteor_autoupdate_clientVersions\",\"id\":\"version-refreshable\",\"fields\":{\"version\":\"ffc60b4f3427064574e698ced2533f82859b0494\",\"assets\":{\"allCss\":[{\"url\":\"/eccb300949f1901eca2ce08af04afb4e448cdf5b.css?meteor_css_resource=true\"}]}}}"]
["{\"msg\":\"method\",\"method\":\"login\",\"params