Skip to content

Instantly share code, notes, and snippets.

Avatar

Anthony Rodriguez arodbits

View GitHub Profile
@arodbits
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
<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 / 1_phpunit-api.md
Created Oct 4, 2015 — forked from loonies/1_phpunit-api.md
PHPUnit Cheat Sheet
View 1_phpunit-api.md

PHPUnit API reference

  • version 3.6

TODO

Check those constraints:

$this->anything()
@arodbits
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 />' +
oLocation.city +
'<br />' +
oLocation.province +
View basic-auth.swift
import Foundation
let config = NSURLSessionConfiguration.defaultSessionConfiguration()
let userPasswordString = "username@gmail.com:password"
let userPasswordData = userPasswordString.dataUsingEncoding(NSUTF8StringEncoding)
let base64EncodedCredential = userPasswordData!.base64EncodedStringWithOptions(nil)
let authString = "Basic \(base64EncodedCredential)"
config.HTTPAdditionalHeaders = ["Authorization" : authString]
let session = NSURLSession(configuration: config)
View 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;