Skip to content

Instantly share code, notes, and snippets.

@ardarda
ardarda / gist:4f71a63d94f21da9abbc9c90236e7261
Created March 4, 2024 06:52
git fetch all with local companions
git branch -r | grep -v '\->' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
git fetch --all
git pull --all
@ardarda
ardarda / gist:5a7bd483db03d1ebe074482b73d8794b
Created November 7, 2023 10:48
git make remote branch names as locals
for b in `git branch -r | grep -v -- '->'`; do git branch --track ${b##origin/} $b; done
@ardarda
ardarda / 138_html_colors.pale
Last active June 13, 2019 06:40
138 Html colors - pale
("#ff1493",
"#fff0f5",
"#ff69b4",
"#c71585",
"#ff00ff",
"#8b008b",
"#800080",
"#da70d6",
"#ee82ee",
"#dda0dd",
@ardarda
ardarda / 128_color.vivid
Last active June 13, 2019 06:33
128 vivid color of rgb
("#FFFFFF",
"#000000",
"#FF0000",
"#00FF00",
"#0000FF",
"#FFFF00",
"#00FFFF",
"#FF00FF",
"#808080",
"#FF8080",
mkdir -p src/main/webapp/frontend/bower_components/my-test-element
cd src/main/webapp/frontend/bower_components/my-test-element
polymer init --name polymer-2-element
rm -rf bower.json bower_components/ demo polymer.json README.md test index.html
@ardarda
ardarda / vaadin.executeJavaScript
Created November 15, 2018 09:42
vaadin js injection
// // top tool bar background color css variable customization point
// UI.getCurrent().getPage().executeJavaScript("window.onload = function() {\n" +
// " setTimeout(function() {\n" +
// " var html = document.getElementsByTagName('html')[0];\n" +
// " html.style.cssText = \"--app-layout-bar-background-color: #004a96\";\n" +
// " }, 0);\n" +
// "};");
@ardarda
ardarda / UIButton+Extension.swift
Created July 26, 2018 07:51 — forked from bleft/UIButton+Extension.swift
UIButton with centered Image and Text
// with the help of: https://gist.github.com/phpmaple/9458264
extension UIButton {
func centerImageAndButton(_ gap: CGFloat, imageOnTop: Bool) {
guard let imageView = self.imageView,
let titleLabel = self.titleLabel else { return }
let sign: CGFloat = imageOnTop ? 1 : -1;
let imageSize = imageView.frame.size;
import UIKit
extension UIView {
var superviews: UnfoldFirstSequence<UIView> {
return sequence(first: self) { view in view.superview }
}
func enclosingView(where predicate: (UIView) -> Bool) -> UIView? {
return superviews.first(where: predicate)
}
@ardarda
ardarda / gist:2db8f62d5acf72af32975f7f6ffff325
Created May 7, 2018 15:16
windows ss portion screenshot
%windir%\system32\SnippingTool.exe
po [RLMRealmConfiguration defaultConfiguration].fileURL