Skip to content

Instantly share code, notes, and snippets.

View stalniy's full-sized avatar
🏠
Working from home

Sergii Stotskyi stalniy

🏠
Working from home
View GitHub Profile
/*
After jquery ui datepicker selection, blur and change
events fire before focus is returned to the input field,
handling a quirk from IE browsers
*/
$("input.dateInput").datepicker({
changeMonth: true,
changeYear: true,
showAnim: "fadeIn",
@stalniy
stalniy / config.json
Last active August 29, 2015 14:06
bootstrap.json
{
"vars": {
"@gray-darker": "lighten(#000, 13.5%)",
"@gray-dark": "#83919e",
"@gray": "#c1cad3",
"@gray-light": "lighten(#000, 60%)",
"@gray-lighter": "lighten(#000, 93.5%)",
"@brand-primary": "#309df0",
"@brand-success": "#00b800",
"@brand-info": "#00c6d8",
# Here's the script I'll use to demonstrate - it just loops forever:
$ cat test.rb
#!/usr/bin/env ruby
loop do
sleep 1
end
# Now, I'll start the script in the background, and redirect stdout and stderr
@stalniy
stalniy / html-loader-without-white-space.js
Created July 25, 2016 11:27
Configuration for webpack html loader which removes all white spaces between tags
{
root: resolve('src'),
minimize: true,
collapseWhitespace: true,
conservativeCollapse: false,
collapseInlineTagWhitespace: true,
removeAttributeQuotes: false,
caseSensitive: true,
customAttrSurround: [
[/#/, /(?:)/],
@stalniy
stalniy / Appfile.rb
Created August 31, 2016 11:32 — forked from ravishtiwari/Appfile.rb
Ionic Build IPA with Fastlane tool
app_identifier "com.yourorganization.mytodoapp" # The bundle identifier of your app
apple_id "<You Apple Id>" # Your Apple email address
# You can uncomment any of the lines below and add your own
# team selection in case you're in multiple teams
# team_name "CAMobileApp"
# team_id "Q2CBPJ58CA"
# you can even provide different app identifiers, Apple IDs and team names per lane:
# https://github.com/KrauseFx/fastlane/blob/master/docs/Appfile.md
@stalniy
stalniy / GIF-Screencast-OSX.md
Created September 14, 2016 08:08 — forked from dergachev/GIF-Screencast-OSX.md
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@stalniy
stalniy / eslint-pushed-changes.sh
Created October 12, 2016 13:06
ESLINT + pre-receive git hook
#!/bin/bash
TEMPDIR=`mktemp -d`
ESLINTRC=$TEMPDIR/.eslintrc
COMMAND="eslint --color -c $ESLINTRC --rule 'import/no-unresolved: 0' --rule 'import/no-duplicates: 0' --rule 'import/export: 0'"
git show HEAD:.eslintrc > $ESLINTRC
echo "### Ensure changes follow our code style... ####"
# See https://www.kernel.org/pub/software/scm/git/docs/githooks.html#pre-receive
@stalniy
stalniy / cordova-upload-transport.js
Created November 1, 2016 10:18
Ionic/Cordova file upload
import { Inject } from 'lib/angular2'
import { File, Transfer } from 'ionic-native'
import { Events } from 'events'
import { Config } from 'config/env'
@Inject(Events, Config)
export class CordovaUploadTransport {
get cacheDirectory() {
return cordova.file.tempDirectory || cordova.file.cacheDirectory
}
@stalniy
stalniy / import-gitlab.sh
Created November 22, 2016 13:45
Creates and pushes projects from one gitlab to another
#!/bin/bash
# Put proper URLs here
SOURCE_GITLAB_URL=http://source.example.net/api/v3/
DESTINATION_GITLAB_URL=http://dest.example.net/api/v3/
DESTINATION_GIT_URL=git@dest.example.net
SOURCE_PRIVATE_KEY=
DESTINATION_PRIVATE_KEY=
TMP_DIR=`mktemp -d`
@stalniy
stalniy / comments.model.js
Last active July 28, 2017 09:41
Blog app feathers
module.exports = function (app) {
const mongooseClient = app.get('mongooseClient');
const { Schema } = mongooseClient;
const Comment = new Schema({
author: { type: Schema.Types.ObjectId, ref: 'users', required: true },
post: { type: Schema.Types.ObjectId, ref: 'posts', required: true },
text: { type: String, required: true },
}, {
timestamps: true
});