Skip to content

Instantly share code, notes, and snippets.

View baslie's full-sized avatar

Roman Purtov baslie

View GitHub Profile
@baslie
baslie / gist:327ae9aa03ec06a9fc84ada6b19a9512
Last active April 25, 2016 09:56
Django: startproject command for windows 7
python C:\path\to\virtualenv\folder\Scripts\django-admin.py startproject projectname
@baslie
baslie / gist:d2b32bc86d1d573ab2be9d9145abe041
Last active June 1, 2016 03:20
WGET: Using wget for proper site-grabbing
// This command downloads only one directory without 'parents' and includes cyrillic filenames
wget --page-requisites --restrict-file-names=nocontrol --no-parent -r -l 20 -e robots=off -U mozilla http://site.com
@baslie
baslie / gist:fa58acd5d87e6456652733b88b65f293
Last active April 25, 2016 09:52
Sublime Text: Regular Expressions
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
FIND & REPLACE
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Example:
/*------------------------------------------
* Comment
*------------------------------------------*/
Regex:
@baslie
baslie / gist:4944820b5bb92f9999543dec22d22ebc
Last active April 25, 2016 09:51
NodeJS: How to delete node_modules folder on Windows machine?
Due to its folder nesting Windows can’t delete the folder as its name is too long. To solve this, install RimRaf:
[npm install rimraf -g]
and delete the node_modules folder easily with:
[rimraf node_modules]
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@baslie
baslie / gist:562da42d7815a2f0b0541a1d54967072
Created June 8, 2016 02:06
SMS: Send SMS via PHP & Bytehand.com
<?php
// Заголовок e-mail
switch ($_POST['subject']) {
case 'zvonok':
$subject = 'Обратный звонок';
break;
case 'budjet':
$subject = 'Просчёт бюджета';
break;
@baslie
baslie / gist:44b2514c7cf13873b43d50f1fd60d7fd
Last active December 5, 2020 22:37
PurifyCSS: CLI Usage
purifycss src/css/main.css src/css/bootstrap.css src/js/main.js --min --info --out src/dist/index.css
====================================================================================================
In example above the command will concat both main.css and bootstrap.css and purify it by looking at what CSS selectors were used inside of main.js. It will then write the result to dist/index.css
usage: purifycss <css> <content> [option ...]
options:
--min Minify CSS
--out [filepath] Filepath to write purified CSS to
2016-09-17 12:35:05> Program: Starting Squirrel Updater: --download https://atom.io/api/updates?version=1.10.2
2016-09-17 12:35:06> Program: Fetching update information, downloading from https://atom.io/api/updates?version=1.10.2
2016-09-17 12:35:08> SingleGlobalInstance: Failed to grab lockfile, will retry: C:\Users\Grigoriy\AppData\Local\Temp\.squirrel-lock-B7C190BD54AF9728A704F75EEE3602DC045E16CD: System.IO.IOException: Процесс не может получить доступ к файлу "C:\Users\Grigoriy\AppData\Local\Temp\.squirrel-lock-B7C190BD54AF9728A704F75EEE3602DC045E16CD", так как этот файл используется другим процессом.
в System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
в System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
в System.IO.FileStream..ctor(String path, FileMode mode, FileA
@baslie
baslie / 2GIS-map.html
Last active September 22, 2016 08:12
Full-width 2GIS Map with popup
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Full-width 2GIS Map</title>
<style>
.map {
margin: 0;
@baslie
baslie / script.html
Last active August 26, 2018 04:55
Спрятать футер / white label
<!-- Битрикс24.Сайты. Вставить в head. -->
<script>
document.addEventListener("DOMContentLoaded", function(event) {
var whiteLabels = document.getElementsByClassName('bitrix-footer'), i;
for (var i = 0; i < whiteLabels.length; i ++) {
whiteLabels[i].style.display = 'none';
}
});
</script>