css implementation of fizz buzz
A Pen by scottshane on CodePen.
function processNum(num) { | |
var _num = num + ""; | |
var _left; | |
var _right; | |
var _palin; | |
if (_num.length % 2 === 0) { | |
_left = (~~(_num.substr(0, _num.length/2))+1).toString().split(''); | |
_palin = (~~_left.concat(_left.slice(0).reverse()).join('')); |
var targetObject = { | |
sayHi(){ return `returning show: ${p.show}` }, | |
show: 'family guy', | |
characters: { | |
dad: 'peter', | |
mom: 'lois', | |
daughter: 'meg', | |
son: 'chris', | |
baby: 'stewie', | |
dog: 'brian' |
const xhr = new window['XMLHttpRequest' || 'ActiveXObject']('MSXML2.XMLHTTP.3.0'); | |
let res; | |
xhr.open('GET', 'some/api/endpoint'); | |
xhr.responseType = 'json'; | |
xhr.onreadystatechange = function () { | |
if (this.status === 200 && this.readyState === 4) { | |
resp = this.response; | |
} | |
} |
#!/usr/bin/perl | |
# svn-clean - Wipes out unversioned files from SVN working copy. | |
# Copyright (C) 2004, 2005, 2006 Simon Perreault | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License | |
# as published by the Free Software Foundation; either version 2 | |
# of the License, or (at your option) any later version. | |
# |
svn st | grep '^?' | awk '{print $2}' | xargs rm -rf |
css implementation of fizz buzz
A Pen by scottshane on CodePen.
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.