Skip to content

Instantly share code, notes, and snippets.

View gpessia's full-sized avatar
🏠
Working from home

gpessia gpessia

🏠
Working from home
View GitHub Profile
@gpessia
gpessia / gist:2427969
Created April 20, 2012 11:45
Keymap - Bold & Italic for Markdown
[
// Sublime Text 2 Keymap - Bold & Italic for Markdown Syntax
{ "keys": ["super+shift+i"], "command": "insert_snippet", "args": {"contents": "*${SELECTION}*" },"context":[{"key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }]},
{ "keys": ["super+shift+b"], "command": "insert_snippet", "args": {"contents": "**${SELECTION}**" },"context":[{"key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }]}
]
@gpessia
gpessia / more.md
Created April 21, 2012 16:17 — forked from vasilisvg/more.md
This is my backup script which syncs my server to my dropbox every day.

The script below is triggered every day from my Mac. I use Hazel to move the tar.gz to an external hard disk once it's finished. This happens every day without me noticing.

You should have a similar script.

@gpessia
gpessia / gist:2709785
Created May 16, 2012 11:50
iPad / iPhone on orientation change
window.onorientationchange = function(){
var orientation = window.orientation;
// Look at the value of window.orientation:
if (orientation === 0){
// iPad is in Portrait mode.
}
else if (orientation === 90){
// iPad is in Landscape mode. The screen is turned to the left.
}
else if (orientation === -90){
@gpessia
gpessia / opacity-st2-snippet.sublime-snippet
Created October 4, 2012 09:16
Cross Browser Opacity - Sublime Text Snippets
<snippet>
<content><![CDATA[
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=${1:50})"; ${3:/* IE 8 */}
filter: alpha(opacity=${1:50}); ${3:/* IE 5-7 */}
-moz-opacity: ${2:0.5}; ${3:/* Netscape */}
-khtml-opacity: ${2:0.5}; ${3:/* Safari 1.x */}
opacity: ${2:0.5}; ${3:/* Good browsers */}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>opacity</tabTrigger>
<!-- copy this to YOUR_THEME.tmTheme-->
<dict>
<key>name</key>
<string>diff: deleted</string>
<key>scope</key>
<string>markup.deleted</string>
<key>settings</key>
<dict>
<key>background</key>
<string>#EAE3CA</string>
@gpessia
gpessia / minimal-css-reset.css
Last active December 16, 2015 22:39
Minimal CSS Reset
/* Reset */
html, body, h1, h2, h3, h4, h5, h6, p, ol, ul, li, dl,
dt, dd, blockquote, address{
margin: 0;
padding: 0;
}
[
//{ "keys": ["super+shift+w"], "command": "insert_snippet", "args": {"name": "Packages/User/w-md.sublime-snippet" }}
{ "keys": ["super+shift+w"], "command": "insert_snippet", "args": {"contents": "${1:p}$SELECTION${1:p}" }},
// Bold & Italic for Markdown Sintax
{ "keys": ["super+shift+i"], "command": "insert_snippet", "args": {"contents": "*${SELECTION}*" },"context":[{"key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }]},
{ "keys": ["super+shift+b"], "command": "insert_snippet", "args": {"contents": "**${SELECTION}**" },"context":[{"key": "selector", "operator": "equal", "operand": "text.html.markdown", "match_all": true }]},
// Bold & Italic for HTML Sintax
{ "keys": ["super+shift+i"], "command": "insert_snippet", "args": {"contents": "<em>${SELECTION}</em>" },"context":[{"key": "selector", "operator": "equal", "operand": "text.html", "match_all": true }]},
@gpessia
gpessia / Helvetica Neue stack
Created January 24, 2014 11:28
Helvetica Neue CSS font-family stack. Is there a web-safe Helvetica Neue CSS font-family stack? - See more at: http://rachaelmoore.name/posts/design/css/web-safe-helvetica-font-stack/#sthash.lt6rYYGz.dpuf
/**
* Helvetica Neue Normal (No Stretch)
*/
/* Helvetica Neue Black Font Stack */
.{font-family: "HelveticaNeueBlack", "HelveticaNeue-Black", "Helvetica Neue Black", "HelveticaNeue", "Helvetica Neue", 'TeXGyreHerosBold', "Arial Black", sans-serif; font-weight:800; font-stretch:normal;}
/* Helvetica Neue Heavy Font Stack */
.{font-family: "HelveticaNeueHeavy", "HelveticaNeue-Heavy", "Helvetica Neue Heavy", "HelveticaNeue", "Helvetica Neue", 'TeXGyreHerosBold', "Arial Black", sans-serif; font-weight:700; font-stretch:normal;}
@gpessia
gpessia / unsplash.sh
Last active August 29, 2015 14:26 — forked from chrismdp/unsplash.sh
Script to grab one of the 10 more recent images from Unsplash, and tint and blur it for use as an iTerm background using Solarized Dark
#!/bin/bash
# NOTE: requires ImageMagick
# NOTE: will tint to the Solarized Dark default background scheme, as the iTerm background blend option didn't lower the contrast enough for me
# NOTE: Optimised for a 1280x800 point screen (my 13" Retina MBP)
set -e
index=$[ 1 + $[ RANDOM % 10 ]]
img=`curl https://unsplash.com/rss/ | xmllint --xpath '/rss/channel/item['$index']/image/url/text()' -`
curl "$img" > ~/unsplash-latest.jpg &&