Skip to content

Instantly share code, notes, and snippets.

View arodbits's full-sized avatar

Anthony Rodriguez arodbits

View GitHub Profile
@arodbits
arodbits / Hello-Angularjs.markdown
Created October 17, 2014 00:44
A Pen by Anthony.

Hello Angularjs

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

A Pen by Anthony on CodePen.

License.

@arodbits
arodbits / Watch.markdown
Created October 17, 2014 19:41
A Pen by Anthony.

Watch

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.

License.

@arodbits
arodbits / index.html
Last active August 29, 2015 14:17 — forked from binishbaig/index.html
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Final Map</title>
<script src="//d3js.org/d3.v3.min.js"></script>
<script src="//d3js.org/topojson.v1.min.js"></script>
<style>
* {
margin: 0;
import Foundation
let config = NSURLSessionConfiguration.defaultSessionConfiguration()
let userPasswordString = "[email protected]:password"
let userPasswordData = userPasswordString.dataUsingEncoding(NSUTF8StringEncoding)
let base64EncodedCredential = userPasswordData!.base64EncodedStringWithOptions(nil)
let authString = "Basic \(base64EncodedCredential)"
config.HTTPAdditionalHeaders = ["Authorization" : authString]
let session = NSURLSession(configuration: config)
@arodbits
arodbits / 1-infowindow-content.js
Last active October 4, 2016 18:57 — forked from tommcfarlin/1-infowindow-content.js
Using Google Maps to add multiple windows to different pins located on the map.
var sContent =
'<h2>' + oLocation.title + '</h2>' +
'<br />' +
'<p>' +
oLocation.address1 + ' ' +
oLocation.address2 +
'<br />' +
oLocation.city +
'<br />' +
oLocation.province +
@arodbits
arodbits / 1_phpunit-api.md
Created October 4, 2015 19:26 — forked from loonies/1_phpunit-api.md
PHPUnit Cheat Sheet

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this-&gt;anything()
@arodbits
arodbits / belongs-to-many.sublime-snippet
Created March 22, 2016 18:04 — forked from adamwathan/belongs-to-many.sublime-snippet
Eloquent Relationship snippets for Sublime Text
<snippet>
<content><![CDATA[
public function ${1:relationship}()
{
return \$this->belongsToMany(${1/^(.+)$/(?1\u$1:)/g}::class, {$2:table});
}
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>belt</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
@arodbits
arodbits / collect_recursive.php
Created October 3, 2016 21:07
Create a collection of nested arrays recursively in Laravel 5.x
<?php
function collect_recursive($value)
{
if (is_array($value)) {
$c = collect($value);
}
$collection = $c->map(function ($item, $key) {
if (is_array($item)) {
@arodbits
arodbits / copy_file_over_ssh.sh
Created October 4, 2016 19:01
Copying a file over ssh
sudo cat ClubsSalesforcexx.csv | go:production "sudo su www-data -c 'cat >> /var/www/ClubsSalesforcexx.csv'"
@arodbits
arodbits / updating.sql
Last active October 14, 2016 16:32
Update a field value on a MYSQL table by using a conditional subquery. Replace the occurrence of a character with a new one.
-- update any occurrence of a quote character from a string in mysql
update site_user as original
join (select site_user.id, replace(site_user.email, "\"", "") as new_email from site_user where email like "%\"%") as conditional
on original.id = conditional.id
set original.email = conditional.new_email;
--follow me on twitter: www.twitter.com/anthonyrod4