Skip to content

Instantly share code, notes, and snippets.

View VadimBrodsky's full-sized avatar

Vadim Brodsky VadimBrodsky

View GitHub Profile
@VadimBrodsky
VadimBrodsky / gist:8566778
Created January 22, 2014 20:28
Workaround for Outlook 2007 button rendering issue.
<div align="center">
<br>
<!--[if mso]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="#" style="color:#ffffff;height:40px;v-text-anchor:middle;width:200px;" stroke="f" fillcolor="#27aae1">
<w:anchorlock/>
<center>
<![endif]-->
<a href="#"
style="background-color:#27aae1; color:#FFFFFF;color:#FFFFFF !important;display:inline-block;font-family: Tahoma, Verdana, Segoe, sans-serif; font-size:13px;font-weight:normal;line-height:40px;text-align:center;text-decoration:none;text-transform:uppercase; width:200px;-webkit-text-size-adjust:none;">{{Study Registration}}</a>
<!--[if mso]>
1. Purchase domain (hover.com)
2. Heroku app for website
* copy existing site
* Make git repo run
$ git init .
$ git add .
$ git commit -a -m "intial commit"
* $ heroku apps:create DOMAIN (https://devcenter.heroku.com/articles/creating-apps)
* $ git push heroku master
* $ heroku domains:add www.DOMAIN.com

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@VadimBrodsky
VadimBrodsky / Analytics-Regex.md
Last active August 29, 2015 14:22
Analytics Spam Filter - Regex

Based on My Stats

Regex:

.*(event-tracking|best-seo-offer|buttons-for-your-website|guardlink|free-social-buttons|Get-Free-Traffic-Now|free-share-buttons|4webmasters|free-share-buttons|Get-Free-Traffic-Now|4webmasters|darodar|trafficmonetize|\-seo|buy-cheap-online|fiverr).*

Test Data:

Templating in EE vs. Craft

Lots of people have asked, so here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft.

Table of Contents

  1. Comments
  2. Conditionals
  3. Loops
@VadimBrodsky
VadimBrodsky / browser-sync.md
Last active August 29, 2015 14:23
Start Browser Sync with Craft

From the Template directory

browser-sync start --proxy "tcs.craft.dev" --directory

Reference - Docs

@VadimBrodsky
VadimBrodsky / emacs.md
Last active December 3, 2015 22:28
Emacs Notes

Emacs Commands

General Commands

  • C-x C-c Exit Emacs
  • C-g Quit partially entered command
  • C-z - Suspend Emacs, returns to command line, fg or %emacs to return back
  • <ESC> <ESC> <ESC> - get out of recursive editing level etc.

Help

@VadimBrodsky
VadimBrodsky / vim.md
Last active October 6, 2015 19:29
Vim Notes

Moving Around

  • hjkl - left, down, up, right
  • - - up char
  • + - down char
  • b - before word
  • B - before code word
  • w - next word
  • W - next code word
  • 0 - line start
  • ^ - first char
@mixin clearfix-micro() {
& {
*zoom: 1;
}
&:before,
&:after {
content: "";
display: table;
}
&:after {
@VadimBrodsky
VadimBrodsky / db-connect-test.php
Last active August 29, 2015 14:27 — forked from chales/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");