Skip to content

Instantly share code, notes, and snippets.

View ricardodantas's full-sized avatar
👋
hi!

Ricardo Dantas ricardodantas

👋
hi!
View GitHub Profile
@ricardodantas
ricardodantas / instagram_scrape.php
Created February 20, 2019 09:28 — forked from cosmocatalano/instagram_scrape.php
Quick-and-dirty Instagram web scrape, just in case you don't think you should have to make your users log in to deliver them public photos.
<?php
//returns a big old hunk of JSON from a non-private IG account page.
function scrape_insta($username) {
$insta_source = file_get_contents('http://instagram.com/'.$username);
$shards = explode('window._sharedData = ', $insta_source);
$insta_json = explode(';</script>', $shards[1]);
$insta_array = json_decode($insta_json[0], TRUE);
return $insta_array;
}
@ricardodantas
ricardodantas / Setup Android Development environment.md
Last active August 24, 2018 15:32 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

@ricardodantas
ricardodantas / paymo.js
Last active August 29, 2015 14:20 — forked from yisraeldov/paymo.js
//Paymo API
/**
* This is a quick wrapper for the Paymo 3.0 API
* Requires (jquery.rest)[https://github.com/jpillora/jquery.rest]
*
* Copyright (c) 2014 Yisrael Dov Lebow <lebow@lebowtech.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
define(function (require) {
var module;
// Setup temporary Google Analytics objects.
window.GoogleAnalyticsObject = "ga";
window.ga = function () { (window.ga.q = window.ga.q || []).push(arguments); };
window.ga.l = 1 * new Date();
// Immediately add a pageview event to the queue.
# ----------------------------------------------------------------------
# /PUBLIC folder .htaccess
# ----------------------------------------------------------------------
# This .htaccess file is recommended
# to be placed at root/public folder
# of your Laravel powered application
# ----------------------------------------------------------------------
# This file works with Laravel 3 and 4
# ----------------------------------------------------------------------
# Turning on the rewrite engine is necessary for the following rules and
@ricardodantas
ricardodantas / hide-text.scss
Last active August 29, 2015 13:56 — forked from anonymous/mycode.js
A hide text SCSS mixin.
// How to use: @include hide-text;
@mixin hide-text() {
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
}
#!/bin/sh
#
# This hook does two things:
#
# 1. update the "info" files that allow the list of references to be
# queries over dumb transports such as http
#
# 2. if this repository looks like it is a non-bare repository, and
# the checked-out branch is pushed to, then update the working copy.
# This makes "push" function somewhat similarly to darcs and bzr.
@ricardodantas
ricardodantas / README.md
Created August 30, 2013 16:38 — forked from oodavid/README.md
deploy with git

Deploy your site with git

This gist assumes:

  • you have a local git repo
  • with an online remote repository (github / bitbucket etc)
  • and a cloud server (Rackspace cloud / Amazon EC2 etc)
    • your (PHP) scripts are served from /var/www/html/
    • your webpages are executed by apache
  • apache's home directory is /var/www/
// Mixin
@mixin keyframes($name) {
@-moz-keyframes #{$name} { @content; }
@-webkit-keyframes #{$name} { @content; }
@-o-keyframes #{$name} { @content; }
@-ms-keyframes #{$name} { @content; }
@-khtml-keyframes #{$name} { @content; }
@keyframes #{$name} { @content; }
}
// Example:
JavaScript.load("/javascripts/something.js");
// With callback (that’s the good thing):
JavaScript.load("http://www.someawesomedomain.com/api.js", function() {
API.use(); // or whatever api.js provides ...
});