Skip to content

Instantly share code, notes, and snippets.

View alundiak's full-sized avatar
👋

Andrii Lundiak alundiak

👋
View GitHub Profile
@alundiak
alundiak / 0_json_data.json
Last active January 30, 2016 07:58
i18n.js Example
// rest response in JSON format.
{
"statuses": [{
"name": "open",
"count": 2
}, {
"name": "pending",
"count": 1
}, {
@alundiak
alundiak / filter.js
Last active January 30, 2016 07:54
dm_jsons
{
"data": {
"filters":[
{"name":"pending","count":155, "order": 2},
{"name":"processing","count":0,"order": 3},
{"name":"open","count":0, "order": 1}
]
}
}
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());
}
}
}
<input type="text" id="dateFrom" name="dateFrom" required ng-disabled="whatever"
ng-model="model.data.dateFrom" bs-datepicker autoclose="true"
data-date-format="MM-dd-yyyy"
/>
var articlesPattern = /( a | an | the )/
@alundiak
alundiak / multipart.html
Last active December 17, 2015 00:25
digital-javascript
<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...'">
</select>
(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
alundiak / osx_defaults.sh
Last active January 30, 2016 07:43
Script, which sets some OS X defaults into non-default state
# http://osxdaily.com/2010/02/12/how-to-quit-the-finder/
defaults write com.apple.finder QuitMenuItem -bool true && killall Finder # false #default
# Finder. Show All
defaults write com.apple.finder AppleShowAllFiles true #false #default
# Enable the debug menu and restart the Mac App Store.
defaults write com.apple.appstore ShowDebugMenu -bool true # false #default
# Use Plain Text Mode as Default
@alundiak
alundiak / wifiscript.sh
Created January 30, 2016 07:44
Script, which watch wifi network, and in case of errors, restart it
#! /usr/bin/env bash
### setup some variables
# Copied from https://discussions.apple.com/thread/6619286?start=15&tstart=0
wifiInterface="en0" # changed from en2 to en0, coz in my case, en0 has 192.168.0.12
wifiIP=$(ipconfig getifaddr "$wifiInterface")
echo "Watching" $wifiInterface "on" $wifiIP
git config --get-all user.name #local repo git config file.
git config --global --get-all user.name #user config file.
git config --system --get-all user.name #system git config file.
git config --global user.name "Andrii Lundiak"
git config --global user.email "landike@gmail.com"
git config --global credential.helper store # if I'm lazy to type password always or setup SSH keys
git config --global push.default simple #
# https://git-scm.com/docs/gitattributes