Skip to content

Instantly share code, notes, and snippets.

View ofstudio's full-sized avatar

Oleg Fomin ofstudio

View GitHub Profile
@ofstudio
ofstudio / defer-promise.js
Last active August 29, 2015 14:02
Javascript Deferred / Promise pattern
/**
* A simple workaround on Deferred / Promise pattern
* with result caching and multiply actions on success / fail
*
* defer() returns methods:
* resolve(data) - request is successfully resolved (returns nothing)
* reject(msg) - request if failed (returns nothing)
* promise() - returns promise function
*
* promise() returns methods:
@ofstudio
ofstudio / ieVersion.js
Created June 16, 2014 19:02
ieVersion.js - returns version of Internet Explorer
/**
*
* Returns the version of Internet Explorer
* or undefined if no Internet Explorer detected
* Tested in IE8 ... IE11
*
* http://stackoverflow.com/a/20815285/3071651
*
*/
function ieVersion () {
@ofstudio
ofstudio / djay2itunes.scpt
Last active August 29, 2015 14:03
Copy BPMs and Keys calculated in Algoriddim djay for Mac to iTunes meta tags
(*
** THIS SCRIPT IS OUTDATED **
Check https://github.com/ofstudio/djay2itunes.js for new version
djay2itunes.scpt
Description: Copy BPMs and Keys calculated in Algoriddim djay for Mac to iTunes meta tags
Version: 0.0.1 / July 2014
@ofstudio
ofstudio / OSAjs-file-folder-exists.js
Created December 28, 2014 11:58
Example of file / folders scripting in OS X with Javascript
/**
* Example of file / folders scripting in OS X with Javascript
* Open /Applications/Script Editor.app, paste the code and click Run button
*
* @author Oleg Fomin <ofstudio@gmail.com>
*
*/
function file_exists(name) {
try {
@ofstudio
ofstudio / OSAjs-dialogs.js
Last active August 29, 2015 14:12
Example of dialogs / notifications scripting in OS X with Javascript
/**
* Example of dialogs / notifications scripting in OS X with Javascript
* Open /Applications/Script Editor.app, paste the code and click Run button
*
* @author Oleg Fomin <ofstudio@gmail.com>
*
*/
var result,
my_app = Application.currentApplication();
@ofstudio
ofstudio / DCevent simple translit example
Created January 14, 2015 15:41
Транслитерация для DCevent.js
<!-- Скрипт транслитерации -->
<script>
function translate(str) {
function strtr(s, replacePairs) {
"use strict";
var str = s.toString(), key, re;
for (key in replacePairs) {
if (replacePairs.hasOwnProperty(key)) {
re = new RegExp(key, "g");
@ofstudio
ofstudio / ghost-post-by-tags.js
Last active August 29, 2015 14:14
Ghost browse posts by tag snippet
var api = require('ghost/core/server/api');
api.posts.browse({
context: {
internal: true
},
tag: 'music'
}).then(function (responce){
console.log(responce);
});
@ofstudio
ofstudio / ByTagHelper.js
Last active August 29, 2015 14:16
Query Ghost posts by tag
var hbs = require('express-hbs'),
api = require('core/server/api'),
async = require('express-hbs/lib/async'), // To redefine `registerAsyncHelper`
registerAsyncHelper;
// Redefine `registerAsyncHelper` from `express-hbs`
registerAsyncHelper = function (name, fn) {
hbs.handlebars.registerHelper(name, function (context, options) {
// Pass `[context, options]` as arg instead of `context` only
return async.resolve(fn.bind(this), [context, options]);

Всем-всем! Уже завтра, в пятницу начнется долгожданный Westie Fest 2013! Несколько важных новостей :)

Для начала хотим представить вам информационного партнера Westie Fest 2013: Телеканал «HD Life» — музыкальные программы, видеоклипы, концерты, информационно-развлекательные программы, модные показы и знаменательные события! http://www.hdlife.ru/

О новостях:

  1. В пятницу у нас будет Welcome Party с 21:00, где мы все наконец встретимся и как следует прогреем танцпол! Также, в пятницу можно будет оплатить участие всем, кто еще не сделал этого.
@ofstudio
ofstudio / Musical Self-Sabotage.md
Created March 30, 2016 14:00
Musical Self-Sabotage: What NOT to Play

Оригинал

Музыкальный самоконтроль: какую музыку лучше не ставить

Широчайший спектр музыки под которую танцуют West Coast Swing привлекает в танец самых разных людей: разных возрастов, культур и вкусов. И для тех, кто занимается развитием и продвижением WCS, очень важно понимать музыкальные пристрастия каждой аудитории.

Музыка, которую вы выбираете для занятий, вечеринок или танцевальных демо может как помочь вам привлечь внимание людей, так и наоборот — отпугнуть. Это статья — не учебник по диджейству, и не список самых лучших песен. Она рассказывает о том как привлекать людей в танец с помощью музыки.

Небольшая предыстория