I hereby claim:
- I am raulmangolin on github.
- I am raulmangolin (https://keybase.io/raulmangolin) on keybase.
- I have a public key ASD030J4Lpp3NFDtVWFOLpwp4C5hLNBpcGMt1DzTLkehwgo
To claim this, I am signing this object:
# Replace any brackets with real values | |
# Try to ssh in to DREAMHOST (ensure it no longer asks for a PW); you may want to restart Terminal | |
ssh [user]@[host] | |
cd ~ | |
mkdir [mydomain_com].git | |
cd [mydomain_com].git | |
git init --bare | |
vi hooks/post-receive | |
# Enter the code from the "post-receive" file (in this gist); save + quit |
var access_token = ''; //Please, set an access token | |
var activeAjaxConnections = 1; | |
var likes = {}; | |
function parseLikes() { | |
var names = document.getElementsByClassName('fcb'); | |
activeAjaxConnections = names.length; | |
for(var i = 0; i < names.length; i++){ | |
var a = names[i].childNodes[0]; |
I hereby claim:
To claim this, I am signing this object:
from decimal import * | |
def wesley_safadao(dia, mes, ano): | |
ano = ano % 100; | |
safadeza = sum(range(mes + 1)) + (Decimal(ano) / 100) * (50 - dia) | |
anjo = 100 - safadeza | |
print "Safadeza = {:.2f}".format(safadeza) | |
print "Anjo = {:.2f}".format(anjo) | |
wesley_safadao(23, 8, 1990); |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
if( /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ) { | |
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1; | |
var is_iphone = navigator.userAgent.toLowerCase().indexOf('iphone') > -1; | |
var is_ipod = navigator.userAgent.toLowerCase().indexOf('ipod') > -1; | |
var ww = ( window.screen.availHeight > window.screen.availWidth ) ? window.screen.availWidth : window.screen.availHeight; //get proper width | |
var mw = 480; // min width of site | |
var ratio = ww / mw; //calculate ratio | |
if( ww < mw ){ //smaller than minimum size |
<?php | |
$path = "uploads/"; | |
$dir = dir($path); | |
echo "<p>List all files from '<strong>{$path}</strong>':</p>"; | |
while ($file = $dir->read()) { | |
echo "<p><a href='" . $path . $file . "'>" . $file . "</a></p>"; | |
} | |
$dir->close(); |
<?php | |
// Open the XML | |
$handle = fopen('file.xml', 'r'); | |
// Get the nodestring incrementally from the xml file by defining a callback | |
// In this case using a anon function. | |
nodeStringFromXMLFile($handle, '<item>', '</item>', function($nodeText){ | |
// Transform the XMLString into an array and | |
print_r(getArrayFromXMLString($nodeText)); |
#!/bin/bash | |
if [ $# -ne 0 ]; then | |
project_name=${1} | |
else | |
echo "usage: makecake.sh [project_name]" | |
exit | |
fi | |
if [ -e ${project_name} ]; then |