Skip to content

Instantly share code, notes, and snippets.


Andrii Lundiak alundiak

View GitHub Profile
View pattern1.js
var articlesPattern = /( a | an | the )/
alundiak / multipart.html
Last active Dec 17, 2015
View multipart.html
<form id="myForm" name="myForm" enctype="multipart/form-data" method="POST"
data-bind="submit: pseudoSubmitForm">
<select data-bind="options: uiTypes,
optionsText: 'typeLabel',
optionsValue: 'typeValue',
value: selectedType,
optionsCaption: 'Choose...'">
View multipart.js
(function (){
var node = document.getElementById('myForm');
function AppViewModel() {
this.uiTypes = ko.observableArray([
{"typeValue":"A", "typeLabel": "1 field type"},
{"typeValue":"B", "typeLabel": "2 fields type"}
alundiak /
Last active Jan 30, 2016
Script, which sets some OS X defaults into non-default state
defaults write QuitMenuItem -bool true && killall Finder # false #default
# Finder. Show All
defaults write AppleShowAllFiles true #false #default
# Enable the debug menu and restart the Mac App Store.
defaults write ShowDebugMenu -bool true # false #default
# Use Plain Text Mode as Default
alundiak /
Created Jan 30, 2016
Script, which watch wifi network, and in case of errors, restart it
#! /usr/bin/env bash
### setup some variables
# Copied from
wifiInterface="en0" # changed from en2 to en0, coz in my case, en0 has
wifiIP=$(ipconfig getifaddr "$wifiInterface")
echo "Watching" $wifiInterface "on" $wifiIP
View datePickerDateFormatIssue.html
<input type="text" id="dateFrom" name="dateFrom" required ng-disabled="whatever"
ng-model="" bs-datepicker autoclose="true"
View normalizelf_vs_trim.js
exec: {
user: {
cmd: 'echo %USERPROFILE%',
stdout: false,
callback: function(varX, stdout){
// trim used to get rid of Windows: \n. For some reason "grunt.util.normalizelf(stdout)" doesn't work
grunt.config.set("userProfileFolder", stdout.trim());
View filter.js
"data": {
{"name":"pending","count":155, "order": 2},
{"name":"processing","count":0,"order": 3},
{"name":"open","count":0, "order": 1}
alundiak / 0_json_data.json
Last active Jan 30, 2016
i18n.js Example
View 0_json_data.json
// rest response in JSON format.
"statuses": [{
"name": "open",
"count": 2
}, {
"name": "pending",
"count": 1
}, {
git config --get-all #local repo git config file.
git config --global --get-all #user config file.
git config --system --get-all #system git config file.
git config --global "Andrii Lundiak"
git config --global ""
git config --global credential.helper store # if I'm lazy to type password always or setup SSH keys
git config --global push.default simple #