Skip to content

Instantly share code, notes, and snippets.

View kolisko's full-sized avatar
🎯
Focusing

404 Not Found kolisko

🎯
Focusing
  • Prague, Czech Republic
View GitHub Profile
@kolisko
kolisko / gist:f415877d455b43e50cf4a399f6500933
Created July 13, 2019 14:22
nifi ExecuteScript Base64 to Hex Javascript Converter
var Base64 = Java.type("java.util.Base64");
// var Hex = Java.type("org.apache.commons.codec.binary.Hex");
var DatatypeConverter = Java.type("javax.xml.bind.DatatypeConverter");
var errorOccurred = false;
var flowFile = session.get();
if (flowFile != null) {
try {
@kolisko
kolisko / gist:72b4d4a987438bc64ecafa023eba0939
Created January 3, 2018 13:55 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@kolisko
kolisko / Export to xls.gs
Created August 20, 2016 08:38
Google Docs Sheet Automatically export to excel xls
// OAuth2 client example https:
// github.com/googlesamples/apps-script-oauth2
// file export documentation and testing
// https://developers.google.com/drive/v3/reference/files/export#try-it
// API credentials
// https://console.developers.google.com/
// error can't execute DocumentApp.getUi() from this context
@kolisko
kolisko / Convert Czech String to Ascii.swift
Created August 20, 2016 08:35
Swift convert czech diacritic string to ascii extension
extension String {
func withoutDiacritic() -> String {
let replaceDict:[Character:Character] = [
"á":"a", "č":"c", "ď":"d", "é":"e", "ě":"e", "í":"i", "ň":"n", "ó":"o", "ř":"r", "š":"s", "ť":"t", "ú":"u", "ů":"u", "ý":"y", "ž":"z",
"Á":"A", "Č":"C", "Ď":"D", "É":"E", "Ě":"E", "Í":"I", "Ň":"N", "Ó":"O", "Ř":"R", "Š":"S", "Ť":"T", "Ú":"U", "Ů":"U", "Ý":"Y", "Ž":"Z"
]
let asciiCharacters = self.characters.map { replaceDict[$0] ?? $0 }
let asciiString:String = String(asciiCharacters)
return asciiString
<fx:Script>
<![CDATA[
import mx.collections.XMLListCollection;
import mx.controls.Alert;
import mx.events.MenuEvent;
[Bindable]
public var menuBarCollection:XMLListCollection;
private var menubarXML:XMLList =
<>
<menuitem label="Menu1" data="top">
<s:ButtonBar dataProvider="{vs}"/>
<mx:ViewStack id="vs" width="200" height="50">
<s:NavigatorContent width="100%" height="100%" label="První stránka">
<s:Label text="Toto je stránka první"/>
</s:NavigatorContent>
<s:NavigatorContent width="100%" height="100%" label="Druhá stránka">
<s:Label text="Toto je stránka druhá"/>
</s:NavigatorContent>
<s:NavigatorContent width="100%" height="100%" label="Třetí stránka">
<s:Label text="Toto je stránka třetí"/>
<!-- example 1 -->
<s:Group>
<s:layout>
<s:HorizontalLayout/>
</s:layout>
<s:Button label="Button 1"/>
<s:Button label="Button 2"/>
<s:Button label="Button 3"/>
<s:Button label="Button 4"/>
</s:Group>
<s:SkinnableDataContainer
itemRenderer="spark.skins.spark.DefaultItemRenderer">
<mx:ArrayList>
<fx:String>Dave Jones</fx:String>
<fx:String>Mary Davis</fx:String>
<fx:String>Debbie Cooper</fx:String>
</mx:ArrayList>  
</s:SkinnableDataContainer>
<s:SkinnableContainer>
<s:layout>
<s:HorizontalLayout/>
</s:layout>
<s:Button label="Button 1"/>
<s:Button label="Button 2"/>
<s:Button label="Button 3"/>
<s:Button label="Button 4"/>
</s:SkinnableContainer>
<s:TextInput text="Vstupní text"/>