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
// thanks https://stackoverflow.com/questions/17965151/override-get-method-in-alloy-model
exports.definition = {
con-fig: {
adapter: {
type: "properties",
collection_name: "careCenter",
idAttribute : "CareCenterID"
}
@zo0m
zo0m / index.js
Created January 3, 2018 16:17
get Chet Faker fancy translation from website
// http://temlyakov.ru/chet-faker-im-into-you-perevod.html
jQuery('tr > td:nth-child(odd)').toArray().map(td => td.childNodes[0].textContent).reduce((allSong, str) => allSong + str + '\n', "");
.element {
position: relative;
top: 50%;
transform: translateY(-50%);
}
@zo0m
zo0m / example.json
Last active March 16, 2017 14:58
ParselMap
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zo0m
zo0m / child-of-example.sass
Created February 19, 2017 19:39
child-of SASS mixin
// thanks : http://thesassway.com/intermediate/referencing-parent-selectors-using-ampersand#comment-2067904467
@mixin child-of($parent) {
@at-root {
#{$parent} %child {
@content;
}
}
@extend %child;
}
@zo0m
zo0m / logAndDif.coffee
Created February 7, 2017 14:12
logAndDif
logAndDif = (text, compareWithMoment)->
currM = Alloy.Globals.Moment();
Ti.API.info "#{text} : #{currM.format 'HH:mm:sss.SSS' } - #{if compareWithMoment then currM.diff(compareWithMoment) else '-'}"
currM
startSetupMoment = logAndDif("start")
logAndDif("transformed", startSetupMoment)
$puzzlePieceHeight : 46px;
$puzzleTextPadding : 10px;
$beforeAfterWidth : 20px;
$pathToPuzzlePieceImage : '/assets/img/puzzle/piece';
@mixin generate-theme($themeName, $mainThemeColor, $fontColor: #333333 ) {
.puzzle-piece {
&.theme-#{$themeName} {
color : $fontColor;
@zo0m
zo0m / repl_1.groovy
Last active January 25, 2017 12:53
Groovy practice
def x = { param1 ->
println("param1 === ${param1}");
};
x(1) // param1 === 1
x(2) // param1 === 2
println(x.class) // class Script1$_run_closure1
println(1.class) // class java.lang.Integer
// - - - - - - - - - - - - - - - - - -
@zo0m
zo0m / uploadFileOnChangeAngularSnippet.jade
Created December 24, 2016 08:32
uploadFileOnChangeAngularSnippet.jade
input#fileToUpload(type='file', onchange='angular.element(this).scope().uploadFile(this.files[0])')
@zo0m
zo0m / getNormalizedWordsArray.es6
Last active December 20, 2016 10:09
String ===> Words array
/*
getNormalizedWordsArray("Hello, my name is Igor. What are you doing?:)")
>>> ["Hello", ",", " ", "my", " ", "name", " ", "is", " ", "Igor", ".", " ", "What", " ", "are", " ", "you", " ", "doing", "?:)"]
*/
function getNormalizedWordsArray(phrase) {
const punctuationRegEx = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]/g;
const spaceRegEx = /\s+/g;
const digitRegEx = /\d/g;
const wordRegEx = /\w/g;