Skip to content

Instantly share code, notes, and snippets.

View szalishchuk's full-sized avatar

Sviatoslav Zalishchuk szalishchuk

View GitHub Profile

Keybase proof

I hereby claim:

  • I am szalishchuk on github.
  • I am szalishchuk (https://keybase.io/szalishchuk) on keybase.
  • I have a public key ASCOrlbKsksST_mVULVj0XS6yXfPKk98Ls-m86q8szftKwo

To claim this, I am signing this object:

Ember.Handlebars.registerBoundHelper('markdown', function (content) {
return new Handlebars.SafeString(markdown.toHTML(content));
});
/*
In template call it on any available property
{{markdown controller.property}}
*/
@szalishchuk
szalishchuk / index.js
Last active August 29, 2015 14:10 — forked from avaz/index.js
import Ember from 'ember';
import ModalSupport from '../mixins/modal-support';
export default Ember.Controller.extend(ModalSupport, {
actions: {
tryModal: function() {
var _this = this;
_this.modalFor({template: 'some-template',
title: 'Some Title'})
@szalishchuk
szalishchuk / ip.js
Last active December 14, 2022 11:04
Get local external ip address with nodejs
var
// Local ip address that we're trying to calculate
address
// Provides a few basic operating-system related utility functions (built-in)
,os = require('os')
// Network interfaces
,ifaces = os.networkInterfaces();
// Iterate over interfaces ...
@szalishchuk
szalishchuk / config.xml
Last active January 4, 2016 20:09
Detect whether the application is running in hybrid or browser mode.
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.phonegap.application" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<access origin="*" />
<content src="phonegap.html" />
<name>Application</name>
<description>Description</description>
<author email="szalishchuk@gmail.com" href="http://phonegap.com">Sviatoslav Zalishchuk</author>
@szalishchuk
szalishchuk / phonegap :: android log
Last active January 4, 2016 19:29 — forked from Carlosriverae/web_console_phonegap
ADB Logcat Web Console for Phonegap Debugging
adb logcat | grep 'Web Console'
- or -
adb logcat | grep "CONSOLE"
@szalishchuk
szalishchuk / gist:7387804
Created November 9, 2013 17:40
node :: web server
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs"),
mime = require('mime'),
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname,