Dmitry Petrov can3p

View when-example.js
1 2 3 4 5 6 7 8 9
var pipeline = require('when/pipeline')
, callbacks = require('when/callbacks');
 
var mockMakeAjaxRequestAndReturnCallback = callbacks.lift(require('mockMakeAjaxRequestAndReturnCallback'));
var mockRenderData = require('mockRenderData');
 
var generateLink = function (domain) {
return 'http://' + domain + '/resource';
};
View diary.bash
1 2 3 4 5 6 7 8 9 10
log() {
LOG_PATH=~/Dropbox/diary/
FNAME=`date "+%Y-%m-%d"`.md
 
HEADER="
*************************************
Time: `date \"+%H:%M:%S\"`
Subject:
Mood:
Music:
View pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
    fetch = +refs/heads/*:refs/remotes/origin/*
    url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

View FileExists.vba
1 2 3 4 5 6 7 8 9
Function FileExists(ByVal fname As String) As String
Dim objFSO As Object
 
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(fname) Then
FileExists = "1"
Else
FileExists = "0"
End If
View alive.vba
1 2 3 4 5 6 7 8 9 10
Function Alive(ByVal url As String) As String
Dim result As String
Dim winHttpReq As Object
Set winHttpReq = CreateObject("WinHttp.WinHttpRequest.5.1")
 
winHttpReq.Open "GET", url, False
 
On Error Resume Next
winHttpReq.Send
If Err.Number = 0 Then
View gist:4055931
1 2 3 4 5 6 7 8 9 10
$ jitsu deploy
info: Welcome to Nodejitsu nko3-vermishel-team
info: jitsu v0.11.3, node v0.8.12
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Analyzing application dependencies in node lib/server.js
info: Creating snapshot 0.0.8-6
info Uploading: [=============================] 100%
info: Updating app nko3-vermishel-team
info: Activating snapshot 0.0.8-6 for nko3-vermishel-team
View gist:4046235
1 2 3 4 5 6 7 8 9 10
do (exports = if typeof exports == 'undefined' then undefined else exports) ->
module = ->
#example module content
_ = require 'underscore'
_([3,1,2]).sort()
 
return {
a: ->
b: ->
}
View gist:1787188
1 2 3 4 5 6 7 8 9 10
/**
* Converts a string that was serialized with jQuery.param back to the object.
*
* @param {String} str
*
* @return {Object}
*/
function parseParams(str) {
var obj = {}, pair;
var pairs = decodeURIComponent(str).split( "&" );
View node_debian_init.sh
1 2 3 4 5 6 7 8 9 10
#! /bin/sh
# ------------------------------------------------------------------------------
# SOME INFOS : fairly standard (debian) init script.
# Note that node doesn't create a PID file (hence --make-pidfile)
# has to be run in the background (hence --background)
# and NOT as root (hence --chuid)
#
# MORE INFOS : INIT SCRIPT http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
# INIT-INFO RULES http://wiki.debian.org/LSBInitScripts
# INSTALL/REMOVE http://www.debian-administration.org/articles/28
View gist:1053285
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env node
 
/**
* Прототип прототипа, точно работать должен только на тестовом примере
* из поста. Для дальнейшей доработки нужно будет ближе ознакомиться со
* спецификацией haml и формализовать правила по трансляции имен классов =)
*
* .b-bl1
* .b-bl2_foo
* .__el
Something went wrong with that request. Please try again.