Skip to content

Instantly share code, notes, and snippets.

View luissquall's full-sized avatar

Luis Ramos luissquall

View GitHub Profile
@luissquall
luissquall / zend_include_path.php
Created January 21, 2012 17:21
Zend include path
<?php ini_set('include_path', ini_get('include_path') . PATH_SEPARATOR . dirname(__FILE__)); ?>
@luissquall
luissquall / chars.php
Last active October 8, 2015 08:28
Characters assertion
<?php
public function testCharacters() {
$this->assertRegExp('/\w/', 'a');
preg_match_all('/[?.!\'\/,\\\;:-]/', '? . ! / , a \ ; : - \'', $matches);
$this->assertEqual($matches[0], array('?', '.', '!', '/', ',', '\\', ';', ':', '-', "'"));
}
?>
@luissquall
luissquall / 00-apache-php-osx.md
Last active November 8, 2017 23:58
Apache & PHP on OS X
{
"name": "hello-world",
"description": "hello world test app",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "3.x"
}
}
@luissquall
luissquall / app.js
Last active December 11, 2015 07:48
var express = require('express');
var app = express();
app.get('/', function (req, res) {
res.send('Hello World!');
})
var server = app.listen(3000, function () {
var host = server.address().address
var port = server.address().port
@luissquall
luissquall / Gruntfile.js
Last active December 16, 2015 08:48
Apply tasks only to changed files.
/*global module:false*/
module.exports = function(grunt) {
// Load tasks
grunt.loadTasks('util/grunt');
// Load vendors tasks
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
<?php
require_once '../src/Google_Client.php';
function pr($content) {
echo '<pre>';
print_r($content);
echo '</pre>';
}
const CLIENT_ID = 'XXXX';
<?php
require_once "../../google-api-php-client/src/Google_Client.php";
require_once "../../google-api-php-client/src/contrib/Google_DriveService.php";
require_once "../../google-api-php-client/src/contrib/Google_Oauth2Service.php";
require_once "../basics.php";
require_once "../config.php";
function buildClient($scopes, $sub = false) {
$key = file_get_contents(SERVICE_ACCOUNT_PKCS12_FILE_PATH);
input:-moz-placeholder, input::-moz-placeholder, input:-ms-input-placeholder, input::-webkit-input-placeholder {
color: white;
}
object {
string apiVersion?;
object {
string kind?;
string lang?;
boolean deleted?;
string selfLink?;
array [
object {}*;
] items?;