Skip to content

Instantly share code, notes, and snippets.

View zo0m's full-sized avatar

Igor Kalashnikov zo0m

  • Full Stack Developer
  • Odessa
View GitHub Profile
@zo0m
zo0m / app.tss
Created December 1, 2016 13:03
FontAwesome Appcelerator Titanium support
".fa" : {
font : {
fontFamily: Alloy.Globals.FONT_AWESOME_FONT_FAMILY,
fontSize : 12
}
}
".fa-10" : {
font : {
fontFamily: Alloy.Globals.FONT_AWESOME_FONT_FAMILY,
moment = require "moment"
crypto = require "crypto"
TelegramBot = require('node-telegram-bot-api')
token = require("./config").token
Place = require "../models/place"
EventType = require "../models/event-type"
Event = require "../models/event"
@zo0m
zo0m / index.js
Created April 26, 2016 11:40 — forked from afranioce/index.js
Appcelerator swipe card like tinder
var win = Titanium.UI.createWindow({
backgroundColor: "#ffffff",
title: "win"
});
// animations
var animateLeft = Ti.UI.createAnimation({
left: -520,
transform: Ti.UI.create2DMatrix({rotate: 60}),
opacity: 0,
@zo0m
zo0m / gdox.js
Last active March 19, 2016 17:34
Google docs search
var statusColumnOffset = 0;
var range = SpreadsheetApp.getActiveSheet().getDataRange();
function setRowColors() {
for (var i = 0; i < range.getLastRow(); i++) {
findFrodOfIP(i);
}
}
function findFrodOfIP(ipIndex) {
@zo0m
zo0m / flatObject.coffee
Created March 16, 2016 14:20
Make object flatt paramObject.subParamObject.subSubSubParam - paramObject_subParamObject_subSubSubParam
convertFlatObject = (objectToFlat)->
flatObject = {}
convertValue = (flatObject, key, value)->
if value isnt null and value isnt undefined
if typeof value is "string" or typeof value is "number"
flatObject[key] = value
else if typeof value is "object"
flatSubObject = convertFlatObject value
@zo0m
zo0m / list.coffee
Created February 13, 2016 09:50
TableView scroll handling on Android , Appcelerator Titanium
previousMoveDirection = "down"
previousItem = 0
upCounter = 0
downCounter = 0
$.eventList.addEventListener "scroll", (event) ->
moveDirection = "down"
currentItem = parseInt event.firstVisibleItem
if currentItem is previousItem
@zo0m
zo0m / list.coffee
Last active February 12, 2016 02:25
TableView scroll event offset on Android , Appcelerator Titanium
# NOT FINISHED
# It works, but not good, for such transformation waiting hyperloop
topOffset = 30
previousOffset = 0
previousFirstVisibleItem = 0
previousOffsetY = 30
previousMoveDirection = "down"
upCounter = 0
@zo0m
zo0m / sqlite.collation.search.coffee
Created January 26, 2016 11:24
SQLITE Collation workaround for search
searchString = "hello z World!"
joinWordsToSearch = (words)->words.join(".{0,5}")
getModifiedWords = (words, modificator)->
modifiedWords = words.slice()
modifiedWords[i] = modificator(word) for word, i in modifiedWords
modifiedWords
@zo0m
zo0m / abstract.coffee
Last active November 21, 2015 22:07
abstract service ACS
class AbstractService
constructor: (@cloud)->
defaultSearchCondition: (searchCondition = {})->
searchCondition.response_json_depth or= 3
searchCondition
buildArrowQueryString: (methodName)=> "/v1/#{@apiName}/#{methodName}.json"
getObjectsFromResponse: (response)=> response?.response?[@apiName] or []
@zo0m
zo0m / controllers__card.coffee
Last active February 19, 2016 23:34
Simple Appecelerator Titanium IOS / Android Mobile Application
args = arguments or [{}]
args = args[0]
humanizeDuration = (eventDuration)->
eventMDuration = Alloy.Globals.Moment.duration(eventDuration, 'seconds');
eventDurationString = ""
if eventMDuration.days() > 0
eventDurationString += " " + Alloy.Globals.Moment.duration(eventMDuration.days(), 'days').humanize()
if eventMDuration.hours() > 0
eventDurationString += " " + Alloy.Globals.Moment.duration(eventMDuration.hours(), 'hours').humanize()