This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while true do | |
system "ipconfig set en1 DHCP" | |
puts "Renewed DHCP Lease...\n" | |
sleep 60 * 4 | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)webViewDidStartLoad:(UIWebView *)theWebView | |
{ | |
for (id subview in theWebView.subviews) | |
if ([[subview class] isSubclassOfClass: [UIScrollView class]]) { | |
((UIScrollView *)subview).bounces = NO; | |
((UIScrollView *)subview).showsVerticalScrollIndicator = NO; | |
} | |
return [ super webViewDidStartLoad:theWebView ]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// An AJAX query is broken down like this... | |
$.ajax({ | |
// This means we're going to pull data; if you're | |
// creating something new on the server, this'll be POST | |
type: "GET", | |
// This tells jQuery to use a cross-domain fetching trick | |
dataType: "jsonp", | |
// The BASE URL we want to query data from |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// ... | |
// Use like... | |
// $this->requestFromGengo('translate/service/languages', 'GET'); | |
// $this->requestFromGengo('translate/job', 'GET', array( | |
// 'id' => 1 | |
// )); | |
// ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.blog-post-content').find('img').each(function() { | |
$(this).parent().mouseover(function() { | |
$(this).find('span').fadeIn('slow'); | |
}).mouseout(function() { | |
$(this).find('span').fadeOut('fast'); | |
}).css({'position': 'relative'}).append(function() { | |
return $('<span>This is an Attribution</span>').css({ | |
'background-color': '#333', | |
'position': 'absolute', | |
'bottom': '0', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.shortcuts import render | |
def template(template_path, content_type = 'text/html'): | |
""" | |
A Decorator that simplifies a lot of Django view-related cruft, in | |
regards to rather verbose view serving. | |
This needs some optimization. This currently caches nothing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- May want a pre/code tag combo here --> | |
<div id="code_block"></div> | |
<script type="text/javascript" src="path/to/githubcommitembed.min.js"></script> | |
<script type="text/javascript"> | |
// Create a new commit to fetch; .fetch() actually fires calls (below). | |
var commit = new GitHubCommit({ | |
username: 'mygengo', | |
reponame: 'mygengo-python', | |
fileSHA: 'cbb0816e1fb873019d8617500e4562299663bf4f', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#spinnerContainer { | |
display: none; | |
position: absolute; | |
top: 340px; | |
right: 350px; | |
width: 54px; | |
height: 54px; | |
} | |
#spinner { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var $ = window.$ = function $(selector) { | |
if(/^#[a-zA-Z_\-]+$/.test(selector)) | |
return document.getElementById(selector.substr(1, selector.length)); | |
return Array.prototype.slice.call(document.querySelectorAll(selector)); | |
}; |