Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@krtek
krtek / _vpn_start
Last active July 3, 2020 07:33
MacOS X Cisco AnyConnect Automation
#!/usr/bin/osascript
tell application "Cisco AnyConnect Secure Mobility Client" to activate
delay 1
tell application "System Events" to tell process "Cisco AnyConnect Secure Mobility Client"
key code 36
end tell
tell application "System Events"
repeat until (exists window "Cisco AnyConnect | VPN KB NONSTANDARD" of application process "Cisco AnyConnect Secure Mobility Client")
@krtek
krtek / keybase.md
Created February 15, 2019 15:24
Keybase

Keybase proof

I hereby claim:

  • I am krtek on github.
  • I am krtekcz (https://keybase.io/krtekcz) on keybase.
  • I have a public key ASCGV3pgXvSyk5ZwWnurlS14l_BQnO46NkdVYKeVyFI1KAo

To claim this, I am signing this object:

@krtek
krtek / flickr-background.js
Last active February 6, 2017 15:22
Flickr background
"use strict";
var API_KEY = '__API_KEY__';
var PHOTOSET_IDS = ['__ID1__', '__ID2__', '__ID3__'];
angular.module('cartagenaApp')
.directive('flickrBackground', function(Flickr, $http) {
var _flickrBackground = function($scope, $element) {
var nextPhoto;
@krtek
krtek / Cancel.java
Last active December 9, 2016 09:27
Blog Alarmy v Androidu
dispatcher.cancel(JOB_TAG);
@krtek
krtek / generators.js
Last active May 2, 2016 13:45 — forked from anonymous/generators.js
Promises vs. generators
var co = require('bluebird').coroutine;
it('should create new banner', co(function* (done) {
//Inicializace dat
//Smažu všechny organizace
yield Organization.removeAsync();
//Poté vytvořím jednu testovací
var organization = yield Organization.createAsync({
name: 'Fragaria s.r.o.'
});
@krtek
krtek / mappings.json
Last active August 29, 2015 14:16
Jak vyhrát prostřeno?
{
"settings": {
"analysis": {
"analyzer": {
"cs_hunspell": {
"type": "custom",
"tokenizer": "standard",
"filter": ["stopwords_CZ", "lowercase", "hunspell_CZ", "asciifolding", "stopwords_CZ", "remove_duplicities"]
}
},
@krtek
krtek / animate-original.html
Last active August 29, 2015 14:12
AngularJS examples
<my-widget>
<div id="one" class="box"></div>
<div id="two" class="box"></div>
</my-widget>
@krtek
krtek / app.js
Last active December 26, 2022 05:00
AngularJS modular application
angular.module('app', ['ngRoute', 'app.core', 'app.user', 'app.settings'])
.config(function($routeProvider, $locationProvider) {
$routeProvider.when('/home', {
templateUrl: 'partials/home.html',
controller: 'HomeCtrl'
});
//Handle all exceptions
$routeProvider.otherwise({
redirectTo: '/home'
@krtek
krtek / core.js
Last active August 29, 2015 14:05
Modular application in Angular.JS
angular.module('core', []).provider('Menu', function() {
var _menu = [];
this.$get = function() {
return {
get: function() {
return _menu;
}
};
};
@krtek
krtek / controllers.coffee
Last active August 24, 2017 21:47
Simple Angular.js filter to search in array of items.
app.controller 'ListController', ($scope, $filter) ->
$scope.search = {}
$scope.all_data = [
{title: 'Three men on the bummel', 'author': 'Jerome Klapka Jerome', meta: {isbn: 2234}}
{title: 'Three men on a boat', 'author': 'Jerome Klapka Jerome', meta: {isbn: 1234}}
{title: 'Three musketeers', 'author': 'Alexandre Dumas', meta: {isbn: 4566}}
{title: 'Four tank men and a dog', 'author': 'Janusz Przymanowsky', meta: {isbn: 1222}}
]
$scope.$watch("search.query", ( ->