Skip to content

Instantly share code, notes, and snippets.

View enzy's full-sized avatar

Matej Simek enzy

View GitHub Profile
@enzy
enzy / generate_localhost_cert.sh
Created April 7, 2020 16:14
Generate self-signed certificate for localhost. Valid for 5 years.
openssl req -x509 -days 1825 -out localhost.crt -keyout localhost.key \
-newkey rsa:2048 -nodes -sha256 \
-subj '/CN=localhost' -extensions EXT -config <( \
printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")
@enzy
enzy / gist:44a5bbb037c75e5d0b40
Created June 19, 2015 12:00
Flexbox cheat sheet
display: flex;
display: inline-flex;
align-content: stretch; /* flex-start | flex-end | center | space-between | space-around | stretch */
align-items: stretch; /* flex-start | flex-end | center | baseline | stretch */
align-self: auto; /* auto | flex-start | flex-end | center | baseline | stretch */
flex: 0 1 auto; /* none | [ <flex-grow> <flex-shrink>? || <flex-basis> ] */
flex-basis: auto; /* <width> */
flex-direction: row; /* row | row-reverse | column | column-reverse */
flex-flow: row nowrap; /* <flex-direction> || <flex-wrap> */
flex-grow: 0; /* <number> */
@enzy
enzy / css.md
Created March 3, 2015 10:49
Coding Standard: CSS

Coding Standard: CSS

Modulární organizace

  • základní stavební jednotka je modul
  • modul má jednu unikátní veřejnou třídu .modul a je v samostatném souboru modul.css
  • vnitřní části označujeme třídou odvozenou pomocí pomlčky .modul-part a .modul-part-subpart
  • modul může mít dále zobrazení .modul.view-name a stav .modul.is-state, které se označují modifikátory na veřejné třídě. Breakpoint (media query) je forma zobrazení.
  • žádné jiné selektory nejsou uvnitř modulu povoleny, kromě: :* + >
  • zápis dodržuje styleguide idiomatic-css
@enzy
enzy / make_guides.jsx
Created January 21, 2015 15:15
Photoshop script to make guides around text objects
#target photoshop
var doc = app.activeDocument;
var guides = app.activeDocument.guides;
function run(){
var layerSets = app.activeDocument.layerSets;
dumpLayerSets(layerSets);
//$.writeln("Top-level layers:");
@enzy
enzy / wox_errorlog.txt
Created January 15, 2015 14:34
Wox Error: System.IO.FileNotFoundException
```
System.IO.FileNotFoundException: C:\Users\Enzy\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Developer Tools for UPnP™ Technology\Device Spy.lnk
Source: System.Drawing
TargetAssembly: System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
TargetModule: System.Drawing.dll
TargetSite: System.Drawing.Icon ExtractAssociatedIcon(System.String, Int32)
at System.Drawing.Icon.ExtractAssociatedIcon(String filePath, Int32 index)
at Wox.ImageLoader.ImageLoader.GetIcon(String fileName) in c:\projects\wox\Wox\ImageLoader\ImageLoader.cs:line 42
at Wox.ImageLoader.ImageLoader.Load(String path, Boolean addToCache) in c:\projects\wox\Wox\ImageLoader\ImageLoader.cs:line 103
at Wox.ImageLoader.ImageLoader.PreloadImages() in c:\projects\wox\Wox\ImageLoader\ImageLoader.cs:line 61
@enzy
enzy / wox_log.txt
Created January 14, 2015 08:00
Wox error: InvalidOperationException: The calling thread cannot access this object because a different thread owns it.
Date:2015-01-14 08:51:42,297 Level:ERROR Msg:Couldn't load plugin Browser Bookmarks: Could not load file or assembly 'Wox.Plugin.BrowserBookmark, Version=1.0.1.248, Culture=neutral, PublicKeyToken=null' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
Date:2015-01-14 08:51:58,907 Level:ERROR Msg:## Exception
```
System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it.
Source: WindowsBase
TargetAssembly: WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
TargetModule: WindowsBase.dll
TargetSite: Void VerifyAccess()
at System.Windows.Threading.Dispatcher.VerifyAccess()
@enzy
enzy / optimize.js
Created January 2, 2015 14:59
Optimize SVGs with Adobe Illustrator CC
#target illustrator
var sourceDir,
destDir,
files,
sourceDoc;
sourceDir = Folder.selectDialog( 'Select the import directory.', '~' );
destDir = Folder.selectDialog( 'Select the export directory.', sourceDir.sourceDir );
@enzy
enzy / nginx.conf
Created June 10, 2014 08:24 — forked from hrach/nginx.conf
server {
listen 80;
server_name example.com;
root d:/webs/example.com/www;
index index.php index.html;
try_files $uri $uri/ /index.php?$args;
location ~ \.phpt?$ {
try_files $uri @missing;

Keybase proof

I hereby claim:

  • I am enzy on github.
  • I am matejsimek (https://keybase.io/matejsimek) on keybase.
  • I have a public key whose fingerprint is 4602 F070 DC61 5FE8 C199 68FA 21EA D8DF C0E1 B290

To claim this, I am signing this object:

@enzy
enzy / Gruntfile.js
Created March 21, 2014 11:12
Ochutnávka Frontbase: build s browser-sync
module.exports = function(grunt) {
var STYLE_FILES = {
'build/screen.css': 'styles/screen.styl'
}
var JS_FILES = {
'build/app.js': [
'js/plugins.js',
'js/init.js'