Skip to content

Instantly share code, notes, and snippets.

View panayotoff's full-sized avatar

Chris panayotoff

View GitHub Profile
@patik
patik / how-to-squash-commits-in-git.md
Last active April 8, 2026 18:17
How to squash commits in git

Squashing Git Commits

The easy and flexible way

This method avoids merge conflicts if you have periodically pulled master into your branch. It also gives you the opportunity to squash into more than 1 commit, or to re-arrange your code into completely different commits (e.g. if you ended up working on three different features but the commits were not consecutive).

Note: You cannot use this method if you intend to open a pull request to merge your feature branch. This method requires committing directly to master.

Switch to the master branch and make sure you are up to date:

@mcaskill
mcaskill / wp-intart-sort.php
Created May 2, 2015 05:35
WordPress : Sort post titles in alphabetical order, disregarding initial definite and indefinite articles
<?php
/**
* File: Sort posts in alphabetical order, ignoring initial articles.
*
* This condition is achieved using the `post_fields` and `posts_orderby`
* filters. The implementer must provide their own list of definite and
* indefinite articles for the hooks to ignore.
*
* To enable natural language sorting, pass the following Query parameter:
@stanio
stanio / locations-comments.js
Created April 22, 2015 13:53
postbank.bg/Applications/Locations/_inc/js/locations.js comments
//тук ще се пазят всички маркери които съм залепил по картата това е Array от обекти тип {marker:object, JSONData:object} - JSONData се използва за да пазя обекта с даните както е дошъл от сървара.
//трябва ми за да си намеря панела при кликане в/у маркера и за да го скролирам до обекта, който е кликнат.
//ще го напълня в PutMarkers и в него ще седят само градовете, които ще нахаквам в комбото с градовете.
//за да не бия постоянно json заявки към сървара, веднъж след като съм го заредил, само крия, показвам! затова ползвам isLoad
//някой вика асинхронно два пъти на onload json ама не мога да го хвана кой. За да оправим проблема проверяваме арея дали е празен и чак тогава стартираме
//използваме малка простотия и си сетваме наш параметър на Google маркера
/*и както се вижда може да си го взема после*/
//правим чудесии от храброст, защото ondblclick изстрелва и clik, и става една мазня.. затова за гледам дали е отворен ако е .. не го пипам.. ако не е го отварям!
/*и както се вижда може да си го взема после*/
/*
@miglen
miglen / postbank.location.js
Created April 22, 2015 07:12
postbank.location.js
/*
Този скрипт е пълен с едни от най-забавните коментари на български.
Разработен е от някой от разработчиците на Iliyan.com за Пощенска банка.
Пазя го за да се смеем ако го променят в сайта.
Оригинална локация: https://www.postbank.bg/Applications/Locations/_inc/js/locations.js
*/
@paulirish
paulirish / bling.js
Last active May 2, 2026 11:52
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
@rezoner
rezoner / easings.js
Created March 2, 2015 17:27
One argument easing equations
/*
A full list of simple easing equations inspired by GIST from greweb - https://gist.github.com/gre/1650294
Equations source - http://gsgd.co.uk/sandbox/jquery/easing/
*/
{
linear: function(t) {
return t
},
inQuad: function(t) {
@ericelliott
ericelliott / essential-javascript-links.md
Last active April 30, 2026 08:09
Essential JavaScript Links

Font Face

A mixin for writing @font-face rules in SASS.

Usage

Create a font face rule. Embedded OpenType, WOFF2, WOFF, TrueType, and SVG files are automatically sourced.

@include font-face(Samplino, fonts/Samplino);
@pburtchaell
pburtchaell / styles.css
Last active February 12, 2025 08:45
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@fta2012
fta2012 / DragTransform
Last active April 17, 2026 20:03
Slightly modified compiled coffeescript from this codepen: http://codepen.io/fta/pen/ifnqH. Paste into console on a page that has jQuery to load the two dependent libraries (jquery-ui and numericjs). Then call makeTransformable('#selector-name') to make that element WYSIWYG editable. Use inspector to get the CSS for the transforms.
var selector = 'img' // Replace this with the selector for the element you want to make transformable
jQuery.getScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js', function() {
jQuery.getScript('//cdnjs.cloudflare.com/ajax/libs/numeric/1.2.6/numeric.min.js', function() {
(function() {
var $, applyTransform, getTransform, makeTransformable;
$ = jQuery;