Skip to content

Instantly share code, notes, and snippets.

View andzi's full-sized avatar

andzil andzi

View GitHub Profile
@andzi
andzi / bem.md
Created September 6, 2016 16:28 — forked from iamstarkov/bem.md
bem
@andzi
andzi / .md
Created September 6, 2016 17:28 — forked from iAdramelk/.md
Длинная телега про Бутстрап

Английская версия: https://evilmartians.com/chronicles/bootstrap-an-intervention

Вводная часть

У CSS есть несколько базовых проблем, которые позволяют очень быстро отстрелить себе ногу при неправильном использовании:

  1. Глобальный неймспейс – в серверном программировании все что написано в файле, в файле и остается. Все же что написано в css и js засирает глобальное пространство имен со всеми вытекающими. В JS эту проблему сейчас побороли всякими модульными системами, а вот с css сложнее. В идеальном мире это должен починить Shadow DOM и настоящие Web Components, но пока их нет единственный способ с этим бороться – следовать какой-то системе именований селекторов, которая по возможности уменьшает и исключает возможные конфликты.

  2. Каскадность – если на один элемент может сработать несколько правил, то они все и сработают последовательно. Если есть элемент h1.title, на него сработают все правила для тегов h1 и все правила для класса .title. Так как весь html состоит из тегов, то правил которые п

@andzi
andzi / exporteps.py
Created September 13, 2016 21:56 — forked from brechtm/exporteps.py
Libre/OpenOffice Draw script to bulk export figures
# Libre/OpenOffice: Export selected or all figures as EPS
# 2010 Brecht Machiels
#
# Usage:
# - drop script in user scripts folder
# Max OSX: $HOME/Library/Application Support/LibreOffice/4/user/scripts/python/
# (Arch) Linux: $HOME/.config/libreoffice/4/user/Scripts/python/
# other Linux: $HOME/.libreoffice/4/user/Scripts/python/
# Windows: C:\Document and Settings\<username>\Application Data\libreoffice\4\user\Scripts\python
# - start Draw and draw some figures
<?
/////////////////////
// slack2html
// by @levelsio
/////////////////////
//
/////////////////////
// WHAT DOES THIS DO?
/////////////////////
//
@andzi
andzi / SumLT_VBA.html
Created March 16, 2017 23:03
Excel funkcijos "Suma žodžiais" įrašymas
<html><HEAD>
<link type="text/css" rel="stylesheet" href="/static/css/banner-styles.css"/>
<TITLE>Verslas-Banga</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1257">
<!-- Software, design (C) UAB Metasite (www.metasite.net) -->
<base href="/web/20071025011434/http://verslas.banga.lt/">
<LINK REL="stylesheet" TYPE="text/css" HREF="stuff/style.css" TITLE="web">
@andzi
andzi / GMailReminder.gs
Created July 26, 2017 14:06 — forked from kshwetabh/GMailReminder.gs
Reminder script for GMail: A simple Google Apps Script to create a Google Calendar event (reminder) for any mail (with a specific label). You can then setup ("timed") triggers in Apps Script... (public version of the GMailReminder gist)
/**
* Reminder script for GMail: A simple Google Apps Script to create a Google Calendar event (reminder) for any mail (with a
* specific label). You can then setup ("timed") triggers in Apps Script (hourly, etc) to monitor your Inbox.
* How to Use:
* 1. Log into Google Drive account and create a Google Script.
* 2. Copy and paste the below snippet into the gs file.
* 3. Make sure to update the 'reminderLabel', 'calendarName' and 'reminderDuration' as per your preference.
* 4. Test the script to make sure it is working properly.
* 5. Setup a time-driven Project Trigger (hourly, etc) to automatically run this script and create calendar events.
*
@andzi
andzi / README-Template.md
Last active August 3, 2017 22:59 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Build Status Code Climate

Note: This project is under development. It is not yet ready for production use.

Project Title

One Paragraph of project description goes here

Getting Started

@andzi
andzi / gist:ecb7e4ca0f2f49d61bd49f13eff02db0
Created August 5, 2017 01:57 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@andzi
andzi / xpath-example.ps1
Created June 24, 2018 22:05 — forked from jpoehls/xpath-example.ps1
Use XPath to update XML using PowerShell
function Edit-XmlNodes {
param (
[xml] $doc = $(throw "doc is a required parameter"),
[string] $xpath = $(throw "xpath is a required parameter"),
[string] $value = $(throw "value is a required parameter"),
[bool] $condition = $true
)
if ($condition -eq $true) {
$nodes = $doc.SelectNodes($xpath)
<iframe class="s1i518j4-2 bLslTo" src="https://www.reddit.com/login"></iframe>
<!DOCTYPE html>
<html lang="en">
<head>
<title>reddit.com: Log in</title>
<link rel="shortcut icon" type="image/png" sizes="512x512" href="https://www.redditstatic.com/accountmanager/favicon/favicon-512x512.png">
<link rel="shortcut icon" type="image/png" sizes="192x192" href="https://www.redditstatic.com/accountmanager/favicon/favicon-192x192.png">
<link rel="shortcut icon" type="image/png" sizes="32x32" href="https://www.redditstatic.com/accountmanager/favicon/favicon-32x32.png">
<link rel="shortcut icon" type="image/png" sizes="16x16" href="https://www.redditstatic.com/accountmanager/favicon/favicon-16x16.png">