Skip to content

Instantly share code, notes, and snippets.

View mogetutu's full-sized avatar

Isaak Mogetutu mogetutu

View GitHub Profile
@mogetutu
mogetutu / revert.sh
Last active August 29, 2015 14:23 — forked from kugaevsky/revert.sh
$ cd /usr/local
$ git checkout b64d9b9c431642a7dd8d85c8de5a530f2c79d924 Library/Formula/node.rb
$ brew unlink node
$ brew install node
$ npm install -g npm@latest

Share Counts

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.

Twitter

@mogetutu
mogetutu / readme
Last active August 29, 2015 14:09 — forked from kamaulynder/readme
Dependencies
Run composer install to get all the php requirements (via composer)
Run npm install to get all the packages necessary for grunt (via npm)
While developing, run grunt in an open terminal window and it will automatically watch for and compile changes to scss and js files (and reload your browser if you have livereload configured). If you need to install grunt, use npm install -g grunt-cli
Run bower install to get all the required frontend components (via bower)
@mogetutu
mogetutu / README.md
Last active August 29, 2015 14:08 — forked from oodavid/README.md

Backup MySQL to Amazon S3

This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)

Sister Document - Restore MySQL from Amazon S3 - read that next

1 - Install s3cmd

this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc

@mogetutu
mogetutu / README.md
Last active August 29, 2015 14:08 — forked from oodavid/README.md

Restore MySQL from Amazon S3

This is a hands-on way to pull down a set of MySQL dumps from Amazon S3 and restore your database with it

Sister Document - Backup MySQL to Amazon S3 - read that first

1 - Set your MySQL password and S3 bucket, make a temp dir, get a list of snapshots

# Set our variables

export mysqlpass="ROOTPASSWORD"

@mogetutu
mogetutu / AC.md
Last active August 29, 2015 14:07
AC
  • Institutions(Name, Desc, Logo)

    • Create
    • View
    • Update
    • Delete
    • Search

    Notes

    --

  • Logos save and served from s3 bucket

@mogetutu
mogetutu / driverscape
Created October 1, 2014 09:39
driverscape
http://www.mediafire.com/download/up179ykk8i5b39k/Driver+Toolkit+8.3.zip
@mogetutu
mogetutu / .vimrc
Last active August 29, 2015 14:06 — forked from JeffreyWay/.vimrc
set nocompatible " Disable vi-compatibility
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
/* Taken zigmob's (http://forums.macrumors.com/showthread.php?t=1742566) workaround a step further
And added some triggers to clean up these dodgy character combinations (ff, fi, fl).
Still crashes on initial message read but saves having to manually run the sql query eve time a message contains the character combinations */
-- Working well for me so far --
/*
Kane Lai 2014-07-13
Improved by updating only the affected row in the trigger.
Also, supplied the restore script too.
*/
@mogetutu
mogetutu / index.html
Created June 26, 2014 13:20
ajax with class changing
<!DOCTYPE html>
<html>
<head>
<title>Brck</title>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script>
setInterval(function(){
$.ajax({ url: "http://localhost:9000/sim.php", success: function(data){
//Update your dashboard gauge
console.log(data);