Skip to content

Instantly share code, notes, and snippets.


Anthony Rodriguez arodbits

View GitHub Profile
View Hello-Angularjs.markdown

Hello Angularjs

Short demo about how angular provides a rich way to provide two-way data binding.

A Pen by Anthony on CodePen.


View Watch.markdown


This time we'll be discussing the method $watch in Angularjs. Let's make our form to inform the user if the password and confirm password match. To achieve it will be creating a new directive and will explain all the elements involved. Have fun!

A Pen by Anthony on CodePen.


View index.html
<!DOCTYPE html>
<head lang="en">
<meta charset="UTF-8">
<title>Final Map</title>
<script src="//"></script>
<script src="//"></script>
* {
margin: 0;
View basic-auth.swift
import Foundation
let config = NSURLSessionConfiguration.defaultSessionConfiguration()
let userPasswordString = ""
let userPasswordData = userPasswordString.dataUsingEncoding(NSUTF8StringEncoding)
let base64EncodedCredential = userPasswordData!.base64EncodedStringWithOptions(nil)
let authString = "Basic \(base64EncodedCredential)"
config.HTTPAdditionalHeaders = ["Authorization" : authString]
let session = NSURLSession(configuration: config)
arodbits /
Created Oct 4, 2015 — forked from loonies/
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6


Check those constraints:

arodbits / belongs-to-many.sublime-snippet
Created Mar 22, 2016 — forked from adamwathan/belongs-to-many.sublime-snippet
Eloquent Relationship snippets for Sublime Text
View belongs-to-many.sublime-snippet
public function ${1:relationship}()
return \$this->belongsToMany(${1/^(.+)$/(?1\u$1:)/g}::class, {$2:table});
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<!-- Optional: Set a scope to limit where the snippet will trigger -->
arodbits / collect_recursive.php
Created Oct 3, 2016
Create a collection of nested arrays recursively in Laravel 5.x
View collect_recursive.php
function collect_recursive($value)
if (is_array($value)) {
$c = collect($value);
$collection = $c->map(function ($item, $key) {
if (is_array($item)) {
arodbits / 1-infowindow-content.js
Last active Oct 4, 2016 — forked from tommcfarlin/1-infowindow-content.js
Using Google Maps to add multiple windows to different pins located on the map.
View 1-infowindow-content.js
var sContent =
'<h2>' + oLocation.title + '</h2>' +
'<br />' +
'<p>' +
oLocation.address1 + ' ' +
oLocation.address2 +
'<br />' + +
'<br />' +
oLocation.province +
arodbits /
Created Oct 4, 2016
Copying a file over ssh
sudo cat ClubsSalesforcexx.csv | go:production "sudo su www-data -c 'cat >> /var/www/ClubsSalesforcexx.csv'"
arodbits / updating.sql
Last active Oct 14, 2016
Update a field value on a MYSQL table by using a conditional subquery. Replace the occurrence of a character with a new one.
View updating.sql
-- update any occurrence of a quote character from a string in mysql
update site_user as original
join (select, replace(, "\"", "") as new_email from site_user where email like "%\"%") as conditional
on =
set = conditional.new_email;
--follow me on twitter: