Skip to content

Instantly share code, notes, and snippets.

View woffleloffle's full-sized avatar

Willem Labuschagne woffleloffle

View GitHub Profile
// ----------------------------------------------------------
// A short snippet for detecting versions of IE in JavaScript
// without resorting to user-agent sniffing
// ----------------------------------------------------------
// If you're not in IE (or IE version is less than 5) then:
// ie === undefined
// If you're in IE (>=5) then you can determine which version:
// ie === 7; // IE7
// Thus, to detect IE:
// if (ie) {}
@chitchcock
chitchcock / 20111011_SteveYeggeGooglePlatformRant.md
Created October 12, 2011 15:53
Stevey's Google Platforms Rant

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@xeoncross
xeoncross / index.php
Created March 8, 2012 17:31
Tiny, SMTP client in PHP
<?php
/*
This is a very tiny proof-of-concept SMTP client. Currently it's over 320 characters (if the var names are compressed). Think you can build one smaller?
*/
ini_set('default_socket_timeout', 3);
$user = 'you@gmail.com';
$pass = '';
$host = 'ssl://smtp.gmail.com';
@woffleloffle
woffleloffle / echo-print
Created February 21, 2014 12:23
Sublime Snippet to wrap a `print_r` with `pre` tags.
<snippet>
<content><![CDATA[
echo "<pre>";
print_r (\$${1:variable});
echo "</pre>";
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>echopre</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.php</scope>
@woffleloffle
woffleloffle / JS Object Merge
Last active August 29, 2015 14:06
Merging two JS Objects into one
/**
* Merge two JS Objects
*
* returns a new Object with values of
* first and second added to each other.
*
* Note:
* Object items should only have integers for values
* ..otherwise, boom!
*/
@woffleloffle
woffleloffle / remove_node_modules.bat
Created October 13, 2014 21:49
Delete pesky `node_modules` folders that are too long in one fell sweep.
mkdir em && robocopy em node_modules /MIR
rmdir em && rmdir node_modules
@asugai
asugai / gist:8408561d5134cf090f78
Last active February 24, 2021 20:10
enable gzip / compression on an Amazon AMI EC2 instance via .htaccess
# Mixings from:
# https://www.clayharmon.com/words/posts/enabling-gzip-compression-on-ec2
# http://www.samaxes.com/2008/04/htaccess-gzip-and-cache-your-site-for-faster-loading-and-bandwidth-saving/
# http://www.tonmoygoswami.com/2013/05/how-to-enable-gzip-on-amazon-elastic.html
# ------------------------------------------------------------------------------
# | Compression |
# ------------------------------------------------------------------------------
<IfModule mod_deflate.c>
@gunjanpatel
gunjanpatel / amazon-ec2-ftp.md
Last active October 10, 2023 15:31
amazon ec2 LAMP and FTP installation and setup
@parmentf
parmentf / GitCommitEmoji.md
Last active July 26, 2024 09:35
Git Commit message Emoji
@woffleloffle
woffleloffle / README.md
Created January 27, 2016 09:12
Squash git commits together.

git squash alias

From here.

Run git config --global --edit and add the following under the [alias] section.

squash = "!f(){ git reset --soft HEAD~${1} && git commit --edit -m\"$(git log --format=%B --reverse HEAD..HEAD@{1})\"; };f"