Skip to content

Instantly share code, notes, and snippets.

@tmcls
tmcls / .bash_profile
Created August 31, 2011 09:10
Ultimate Bash
# Git completion: https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion
source ~/.git-completion.sh
# Git Flow completion: https://github.com/bobthecow/git-flow-completion
source ~/.git-flow-completion.sh
# Make the PS1 beter
PS1='\e[0;34m\][\t] \e[0;32m\]\u@\h \w`__git_ps1`:\e[0m\] \[\033]0;\h: \W\007\]'
# Aliases
@tmcls
tmcls / UpdateCSS.js
Created August 24, 2012 08:17
Run this jQuery script to update your css. Be creative and create a bookmarklet from it ;-)
$("link[rel=stylesheet]").each(function(){
var url = $(this).attr('href');
url = url.replace(/\?tcnc=\d+/,'').replace(/\&tcnc=\d+/,'');
url += (url.indexOf('?')>0 ? '&' : '?') + 'tcnc=' + (new Date()).getTime();
$(this).attr('href', url);
console.log('[UPDATED CSS] '+ url);
});
@tmcls
tmcls / replace404images.js
Created August 24, 2012 09:16
Replace broken images with some cool images
$('img').each(function() {
if((typeof this.naturalWidth != "undefined" && this.naturalWidth == 0 ) || this.readyState == 'uninitialized' ) {
console.log('[REPLACE 404 IMG] '+ $(this).attr('src'));
$(this).attr('src', '//lorempixel.com/250/250/?' + Math.random());
}
});
@tmcls
tmcls / VikingCo_Engineering_community_manifesto.md
Created April 23, 2013 13:32
VikingCo Engineering community manifesto

#VikingCo Engineering community manifesto

This is the official VikingCo Engineering G+ community manifesto, please follow these simple Do’s and Don’s.

##DO's:

  • DO use the awesome categories feature when you post something. A question should go to "Ask" category. You're smart, you'll figure it out.
  • DO post amazing things related to Python, Django, Front End, Javascript, HTML5, CSS3, API’s, etc in the category “Share”.
  • DO engage in discussions regarding development, new ideas, best practices, mobile web, web in general
  • DO invite your friends, boyfriends, girlfriends , dogs, cats, mice, and others...
<?php
/**
* The template used for displaying page content in page.php
*
* @package WordPress
* @subpackage Twenty_Twelve
* @since Twenty Twelve 1.0
*/
?>
@tmcls
tmcls / README
Last active August 29, 2015 14:01
Check Syntra website for updates
Only works on OSX.
Run with:
~: python run.py
If you haven't installed httplib2, run first:
~: sudo pip install httplib2
if you haven't installed PIP, run first:
@tmcls
tmcls / deals_draft.json
Last active August 4, 2017 16:58
Deals Json
[
{
"slug":"zalando",
"title":"Zalando",
"subtitle":"Shop online",
"visibility":"publishable",
"is_published":true,
"logo_image":"https://www.dropbox.com/s/9005bsjr493xid5/100-crop-c0-5__0-5-200x200-70.jpg?dl=1",
"header_image":"https://www.dropbox.com/s/1x67yay8jda55hl/vm-banners-05-wide-crop-c0-65__0-21-1200x400-70.jpg?dl=1",
"code_type":null,

Keybase proof

I hereby claim:

  • I am tomclaus on github.
  • I am tomclaus (https://keybase.io/tomclaus) on keybase.
  • I have a public key whose fingerprint is 372C 5DA7 CB53 9C4D A9DE 60E5 30B9 867B 24D8 3976

To claim this, I am signing this object:

[
{
"code_type": null,
"custom_cta_text": "Naar Hello bank! >",
"deals": [
{
"description": "Per transactie met je bankkaart",
"end_date": null,
"highlight": true,
"image": "https://viking-deals-production.s3.amazonaws.com/__sized__/catalog/deals/image/Hello_Footer_v5-crop-c0-53__0-6-1200x400-70.jpg",
/*
* FUNCTION getOriginUrl
* Go to he main domain, follow all the redirect till the end (statuscode 200)
*/
function getOriginUrl($url){
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt($ch, CURLOPT_ENCODING, "" );
curl_setopt($ch, CURLOPT_HEADER, 1);