Skip to content

Instantly share code, notes, and snippets.

View petrosh's full-sized avatar

Alex Petrosh petrosh

View GitHub Profile
@petrosh
petrosh / index.php
Last active August 29, 2015 13:56
Jupiter moons position
<?php
// http://www.petrosh.com/tutorials/2012/planet_position/
$Y=date('Y');
$M=date('n');
$T=date('B');// 000 to 999
$TD=$T/1000;
$D=date('j')+$TD;
// sputnik 1
@petrosh
petrosh / gamma-jquery-hover-injected-element.js
Last active August 29, 2015 14:02
hover injected elements
// http://stackoverflow.com/a/9827114/3469233
$(document).on({
mouseenter: function () {
//stuff to do on mouse enter
},
mouseleave: function () {
//stuff to do on mouse leave
}
}, ".selector"); //pass the element as an argument to .on
@petrosh
petrosh / gamma-terminal-finder.sh
Last active August 29, 2015 14:02
enhance finder from terminal
# Show hidden files
$ defaults write com.apple.finder AppleShowAllFiles TRUE
$ killall Finder
# Show full path bar
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
killall Finder
@petrosh
petrosh / gamma.js
Created June 24, 2014 16:50
jquery scope elements
$('a[href$="ABC"]').remove();
/*
= is exactly equal
!= is not equal
^= is starts with
$= is ends with
*= is contains
*/
@petrosh
petrosh / gamma-wet-wolfenstein-map.md
Last active August 29, 2015 14:03
WET maps idea

BBQ

The allies have to break into the location with a truck of beer, reach bbq build and heat it.
Axis must prevent this and can win in advance keeping pump inverted till pool is empty.

Allies objective

  • Destroy the main entrance
  • Escort truck to bbq
  • Build bbq and secure woods in it
@petrosh
petrosh / gamma-wordpress-cani-gatti-blog.md
Last active August 29, 2015 14:04
gatti e cani wordpress

Home

Siamo un gruppo di volontarie attivo in Umbria e nel Lazio che non riesce a tirare dritto quando incontra un gatto o un cane randagio, affamato o bisognoso di cure e si attiva per salvarlo, curarlo e trovare una famiglia che lo voglia adottare.

Su questo sito raccontiamo le storie degli amici a quattro zampe che col nostro aiuto hanno trovato una famiglia che si occupa di loro, e dei purtroppo numerosi cani e gatti che ancora non hanno una casa.

Leggete le loro storie, guardate le loro foto e se volete adottarne qualcuno, contattateci (link).
Se volete darci una mano ecco come aiutarci (link).

Amici che cercano casa

<ul id="menu">
<li><a href="/">HOME</a></li>
<li><a href="/about">ABOUT</a></li>
<li><a href="/contact">CONTACT</a></li>
</ul>
@petrosh
petrosh / jekyll-homeloop.html
Last active August 29, 2015 14:06
Mavericks jekyll
<!-- loop categories and sort by volume number -->
{% for labels in site.data.labels %}
{% assign cat = {labels.code} %}
{% assign rev = site.categories[cat] | sort: 'volume' %}
{% for post in rev reversed %}
<p>{{ post.category }} {{ post.volume }} {{ post.title }}</p>
{% endfor %}
@petrosh
petrosh / gamma-terminal.sh
Created September 30, 2014 09:51
Terminal useful
# list hidden files
$ ls -a
# remove files and folders
$ rm -R
@petrosh
petrosh / gamma-php-url-fix-encode.php
Last active August 29, 2015 14:07
php accented url fix
<? $_GET['msg'] = str_replace('À', 'A\'', $_GET['msg']); ?>