Skip to content

Instantly share code, notes, and snippets.

View a-ignatov-parc's full-sized avatar

Anton Ignatov a-ignatov-parc

View GitHub Profile
@a-ignatov-parc
a-ignatov-parc / gist:3045497
Created July 4, 2012 05:16
Примеры форматирования чейнинга в коде
// Нету чейнинга
this.$el.find('.js-search_city-suggest');
// Чейнинг без присваивания
this.$el
.find('.js-search_city-suggest')
.typeahead();
// Чейнинг с присваиванием в переменную
var city = this.$el
@andreychev
andreychev / detectIPadVersion.js
Created July 21, 2012 15:33
Функция для определия модели Айпеда.
// функция для определения модели Айпада
function detectIPadVersion(callback, undefined) {
if ('ondevicemotion' in window) {
window.addEventListener('devicemotion', function self(event) {
if (~navigator.platform.indexOf('iPad')) {
var version = event.acceleration ? (window.devicePixelRatio === 2) + 2 : 1;
}
window.removeEventListener('devicemotion', self);
callback(version);
@madrobby
madrobby / gist:3161015
Created July 22, 2012 20:43
Detect retina support. Tested on iOS, Android 2.x, Chrome for Android, Safari on MacBook Pro Retina, Firefox mobile (beta) for Android, Opera Mobile (Android)
function isRetina(){
return (('devicePixelRatio' in window && devicePixelRatio > 1) ||
('matchMedia' in window && matchMedia("(min-resolution:144dpi)").matches))
}
@sapegin
sapegin / grunt.js
Created August 15, 2012 08:42
Sapegin.me gruntfile
@soffes
soffes / perferences.json
Created August 22, 2012 05:35
My Sublime Text 2 config
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Espresso Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
".gitkeep",
"dump.rdb"
],
@agnoster
agnoster / README.md
Last active October 15, 2025 04:02
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@fanzeyi
fanzeyi / scroll.css
Created November 1, 2012 18:34
Google Plus Scroll Style
::-webkit-scrollbar{
height:16px;
overflow:visible;
width:16px;
}
::-webkit-scrollbar-button{
height:0;
width:0;
}
@a-kosygin-parc
a-kosygin-parc / gist:5144272
Created March 12, 2013 16:17
Правильная ссылка на товар
{* 1) Ссылка на страничку с карточкой товара *}
<a href="{"products.view?product_id=`$product.product_id`"|fn_url}">Ссылка на карточку товара</a>
{* 2) Тоже самое что и первая ссылка, но оформлено в виде подключаемого извне шаблона. Там много интересного *}
{include file="buttons/button.tpl" but_href="products.view?product_id=`$product.product_id`" but_text=$lang.view_details but_role="submit"}
{**
* 3) Ссылка на быстрый просмотр карточки товара
* Если вызывается AJAX, то возвращает шаблон views/products/quick_view.tpl
* иначе редиректит на ссылку вида 1)
@jpawlowski
jpawlowski / brew-sync.sh
Last active September 26, 2023 19:54
Sync Homebrew installations between Macs via Dropbox
#!/bin/bash
# Sync Homebrew installations between Macs via Dropbox
#
BREW="/usr/local/bin/brew"
# first get local settings
echo "Reading local settings ..."
rm -f /tmp/brew-sync.*
@pistachiomatt
pistachiomatt / sprite-generation-with-retina.scss
Last active November 5, 2019 12:28
This function generates a sprite sheet of icons, swaps it out for retina versions, and generates the "width" and "height" properties of the icons for you— automatically. Because we're lazy and have better things to do!
// Stick all your icons in a subfolder in your images folder. Put retina versions in a subfolder of that called "@2x".
$sprites: sprite-map("NAME_OF_SUBFOLDER/*.png");
$sprites2x: sprite-map("NAME_OF_SUBFOLDER/@2x/*.png");
// stolen from 37signals
@mixin retina-media() {
@media (min--moz-device-pixel-ratio: 1.3),
(-webkit-min-device-pixel-ratio: 1.3),
(min-device-pixel-ratio: 1.3),
(min-resolution: 1.3dppx) {