Skip to content

Instantly share code, notes, and snippets.

View starikovs's full-sized avatar
👨‍💻
Coding

Viacheslav Starikov starikovs

👨‍💻
Coding
View GitHub Profile
@starikovs
starikovs / gist:4980295
Last active December 13, 2015 21:49
Small alt-checkbox.
<input type="checkbox" id="checkbox1">
<label for="checkbox1">Check Me! I'm small.</label>
<script>
jQuery("#checkbox1").altCheckbox({
outlineUnchecked: false,
sizeClass: "small"
});
</script>
@starikovs
starikovs / gist:4980428
Last active December 13, 2015 21:49
Medium alt-checkbox.
<input type="checkbox" id="checkbox2">
<label for="checkbox2">Check Me! I'm medium.</label>
<script>
jQuery("#checkbox2").altCheckbox({
// Some options can be placed here.
// Don't pass any options to use defaults.
});
</script>
@starikovs
starikovs / gist:4980567
Last active December 13, 2015 21:58
Big alt-checkbox.
<input type="checkbox" id="checkbox3">
<label for="checkbox3">Check Me! I'm big.</label>
<script>
jQuery("#checkbox3").altCheckbox({
iconClass: "fontawesome-remove",
sizeClass: "big"
});
</script>
@starikovs
starikovs / gist:5008245
Last active December 14, 2015 01:39
alt-checkbox demo page
<!DOCTYPE html>
<html>
<head>
<title>alt-checkbox demo</title>
<!-- Include jQuery library to the head section -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<!-- @import the desired icon font in the alt-checkbox-icon-font.css and
include this css file in the head section, Font Awesome is used by default -->
@starikovs
starikovs / alt-checkbox-demo.php
Last active December 14, 2015 18:09
Php alt-checkbox demo snippet
<?php if (isset($_POST['checkbox1'])) : ?>
<p style="color: #ffa500">Checked!</p>
<?php endif; ?>
<form action="demo.php" method="post">
<input type="checkbox" id="checkbox1" name="checkbox1" <?php if (isset($_POST['checkbox1'])) : ?> checked<?php endif; ?>>
<label for="checkbox1" >Check Me! I'm medium.</label>
<br><br>
<input type="submit">
</form>
--- moving around ---
h j k l
2h 3j 4k 5l
0 ^ $
w b e, W B E
fx Fx
tx Tx
G 3G
--- cwd Projects/long-dialog ---
:CtrlP
:CtrlP site
-- when CtrlP is open ---
F5 - cache
c-f - forward
c-b - back
c-d - path/file
--- text ---
(many of these commands may be combined with ⇧ Shift to select a region of text)
Cmd + right, Cmd + left (end and beginning of line)
Opt + right, Opt + left (end and beginning of word)
Cmd + up, Cmd + down (beginning and end of document)
brew update; # update packages' info
brew upgrade; # upgrade outdated packages
brew install <some_package>; # install package which you want
brew install vim
brew install mysql
brew doctor
brew search vim
@starikovs
starikovs / linux
Last active August 29, 2015 13:56
--- ls ---
ls -dl */ (list only directories)
ls -l | grep "^d"
--- copy ---
rsync options source destination (http://cloudtips.org/rsync.html)
rsync -zvr /tmp/helloworld/ /root/message