Skip to content

Instantly share code, notes, and snippets.

View studentIvan's full-sized avatar
🎯
Focusing

Ivan Maslov | JavaScript & Web Performance Enthusiast studentIvan

🎯
Focusing
View GitHub Profile
/**
* iPhone mixin
* example:
* +iphone(all, landscape)
* body
* display none
*/
iphone($version = all, $orientation = all)
$orientation == all ? 'and' : 'and (orientation: ' + $orientation + ') and'
if $version == '4' or $version == '4S' or $version == 'all'
ipad($version = all, $orientation = all)
$orientation == all ? 'and' : 'and (orientation: ' + $orientation + ') and'
if $version == mini or $version == 1 or $version == 2 or $version == all
$query = 'only screen and (min-device-width: 768px) and (max-device-width: 1024px) %s (-webkit-min-device-pixel-ratio: 1)' % $media-orientation
@media $query
{block}
if $version == 3 $version == 4 or $version == all
$query = 'only screen and (min-device-width: 768px) and (max-device-width: 1024px) %s (-webkit-min-device-pixel-ratio: 2)' % $media-orientation
@media $query
{block}
@studentIvan
studentIvan / datepicker.js
Created October 9, 2016 16:23
Datepicker ES6 PickMeUp component example with flat mode
import pickmeup from 'pickmeup'
import moment from 'moment'
const init = () => {
$(() => {
let today = new Date(), next3months = moment().add(3, 'months').toDate();
let element = document.querySelector('.choose-date__datepickerbox');
if (!element) {
return;
mixin chooseDate(options)
+b.choose-date
+e.datepicker
input(type='text' placeholder='Pick a date')
+fontIcon({ name: 'calendar' })
+e.datepickerbox
mixin chooseDate(options)
+b.choose-date
+e.datepicker
input(type='text' placeholder='Pick a date')
+fontIcon({ name: 'calendar' })
/**
* @package PickMeUp
* @author Nazar Mokrynskyi <[email protected]>
* @author Stefan Petre <www.eyecon.ro>
* @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
* @copyright Copyright (c) 2008-2009, Stefan Petre
* @license MIT License, see license.txt
*/
$__border-radius = 0
$__border-color = #e0e0e0;
@studentIvan
studentIvan / capacitor.js
Created May 25, 2016 10:18
Удобная мелкая вещь для сглаживания вызова операций, например var x = new OperatingCapacitor(); x.register('scroll', function () {alert(123)}); x.register('scroll', function () {alert(456)}); x.run('scroll'); // вызовет alert 456
/**
* Сглаживание вызова операций
*
* @returns {{broker: {}, register: function, run: function}}
* @constructor
*/
var OperatingCapacitor = function () {
var object;
object = {
.idea
*.pyc
.DS_Store
#!/bin/bash
cd ~/my/project/backend/
source ~/.virtualenvs/myenv/bin/activate
PS1="\u@\h:\w\$ "
echo -ne "\033]0;Django Backend Server\007"
./manage.py runserver
read -p "Press any key..."