Skip to content

Instantly share code, notes, and snippets.

Roman Veselý crazko

Block or report user

Report or block crazko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@crazko
crazko / spaceship-zsh-git-cheatsheet.md
Created Feb 13, 2019
🚀⭐ Spaceship ZSH Git cheatsheet
View spaceship-zsh-git-cheatsheet.md

🚀Spaceship ZSH Git cheatsheet

symbol description
? untracked changes
+ uncommitted changes in the index
! unstaged changes
» renamed files
deleted files
$ stashed changes
@crazko
crazko / deploy.sh
Created Jan 14, 2019
Shell script run from Travis to perform a deploy to Netlify via zip file
View deploy.sh
#!/usr/bin/env bash
set -e
cd dist
zip -r ../site.zip ./*
cd ..
curl -H "Content-Type: application/zip" \
-H "Authorization: Bearer $NETLIFY_TOKEN" \
@crazko
crazko / gulpfile.js
Last active Jan 4, 2019
Example gulp settings for easy frontend development. https://romanvesely.com/easy-frontend-development/
View gulpfile.js
const { src, dest, series, parallel, watch } = require("gulp");
const del = require("del");
const browserSync = require("browser-sync").create();
const nunjucks = require("gulp-nunjucks");
const less = require("gulp-less");
const concat = require("gulp-concat");
const groupCSSMediaQueries = require("gulp-group-css-media-queries");
const package = require("./package.json");
const siteName = package.name || "Template";
@crazko
crazko / index.php
Created Dec 30, 2018
radio slovensko download
View index.php
<?php
use Symfony\Component\DomCrawler\Crawler;
$loader = require __DIR__ . '/vendor/autoload.php';
$list = file('list.txt');
$index = fopen('index.html', 'w');
$commands = fopen('commands.sh', 'w');
@crazko
crazko / .htaccess
Created Jul 24, 2018
https www redirection
View .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
<FilesMatch "\.(html|htm|js|css)$">
@crazko
crazko / typings.ts
Last active Jul 24, 2018
Guard argument property names
View typings.ts
// https://stackoverflow.com/questions/50371994/typescript-type-guarding-of-argument-based-on-the-previous-one
// type CustomType <T> = {
// [K in keyof T]: number
// };
// type Config <T> = {
// [K in keyof T]? : {
// highPriority: boolean;
// callback: (values: any[]) => number[];
// }
@crazko
crazko / handle_request
Last active Aug 29, 2015
Starting code for handle_request method
View handle_request
CONSTANTS:
c_get TYPE string VALUE 'GET',
c_post TYPE string VALUE 'POST',
c_put TYPE string VALUE 'PUT',
c_delete TYPE string VALUE 'DELETE'.
TYPES:
BEGIN OF local_type_response,
success TYPE string,
msg TYPE string,
View bootstrap_pagination.php
<?php
/**
* Bootstrap Pagination.
*
* Echos Bootstraped paginated links (http://getbootstrap.com/components/#pagination).
*
* @since 0.0.1
*
* @param array $args {
* An array of arguments. Optional.
@crazko
crazko / get_data
Created Sep 29, 2014
Get data from class' attributes in a loop.
View get_data
METHOD get_data.
DATA:
ls_employee TYPE zpy_sk_st_empl,
lv_attrname TYPE abap_attrname,
lv_attr_ref TYPE string,
lv_struc_ref TYPE string.
FIELD-SYMBOLS:
<attr_desc> TYPE abap_attrdescr,
@crazko
crazko / get_attributes
Created Sep 29, 2014
Get class' attributes
View get_attributes
METHOD get_attributes.
DATA:
lo_ref_obj TYPE REF TO cl_abap_objectdescr.
FIELD-SYMBOLS:
<attr_desc> TYPE abap_attrdescr.
" Get class description
lo_ref_obj ?= cl_abap_classdescr=>describe_by_object_ref( me ).
You can’t perform that action at this time.