Skip to content

Instantly share code, notes, and snippets.

View xiel's full-sized avatar
🖖

Felix Leupold xiel

🖖
View GitHub Profile
@xiel
xiel / gist:c5f645e89499874f4d1f5c99da002041
Created February 19, 2019 21:55
Add Spaces to Dock in OS X
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}'; killall Dock
@xiel
xiel / delete-folders-with-name.sh
Created February 18, 2019 22:36
Delete all folders with a specific name recursively (including their contents)
Delete all folders with given name, example “.svn” etc.
find . -type d -name '.svn' -print -exec rm -rf {} \;
find . -type d -name '.idea' -print -exec rm -rf {} \;
find . -type d -name '.sass-cache' -print -exec rm -rf {} \;
find . -type d -name 'node_modules' -print -exec rm -rf {} \;
@xiel
xiel / useBreakpointMatch.ts
Last active June 2, 2022 18:50
useBreakpointMatch (breakpoint helper hook for material-ui)
import * as React from 'react'
import { useState, useLayoutEffect } from 'react'
import { useTheme } from '@material-ui/styles'
import { Theme } from '@material-ui/core'
import { Breakpoint } from '@material-ui/core/styles/createBreakpoints'
export type BreakpointVisiblityValues =
| 'xsOnly'
| 'smOnly'
| 'mdOnly'
@xiel
xiel / JSDateForDateFormatter.swift
Last active December 16, 2015 13:38
Transform JS Date String to NSDate or localizedString | supports JavaScript/ECMAScript Date Time String Format (simplification of the ISO 8601)
//
// NSDateFormatter extension
// Transform JS Date String to NSDate or localizedString
//
// Created by Felix Leupold on 16.12.15 © 2015 XIEL development.
// License: WTFPL / MIT
//
// Usage Examples:
// NSDateFormatter.dateFromJsDateString("2015-11-22T16:09:19.000Z");
// NSDateFormatter.localizedStringFromJsDateString("2015-11-22T16:09:19.000Z");
@xiel
xiel / initial-value.js
Created November 13, 2015 11:06
initialValue attribute directive for angular
/** Get and Render initial value from HTML attr (data from BackEnd)
* license: MIT
*/
angular.module('bra.global.directive')
.directive('initialValue', ['$parse', function($parse) {
'use strict';
//trim input values (eg. textareas)
var removeIndent = function (str) {
@xiel
xiel / Moving Line Buttons.markdown
Created August 27, 2015 16:41
Moving Line Buttons
@xiel
xiel / index.html
Created September 24, 2014 08:56
FileReader Error // source http://jsbin.com/yucavaxiyufi/6
<!DOCTYPE html>
<html>
<head>
<title>FileReader Error</title>
</head>
<body>
<form>
<input id="fileInput" type="file" accept-"image/*">
</form>
<div id="output"></div>
@xiel
xiel / dabblet.css
Created November 14, 2012 23:24
Pseudo-Element Transition Webkit Bug Fix
/*
Pseudo-Element Transition Webkit Bug Fix
*/
a {
transition: 500ms; /* only the parent element needs the transition */
}
a {
position: relative;
border: 0 none;
@xiel
xiel / dabblet.css
Created November 14, 2012 23:17
Pseudo-Element Transition Webkit Bug
/*
Pseudo-Element Transition Webkit Bug
*/
a,
a:after {
transition: 500ms; /* transition for both */
}
a {
position: relative;