Skip to content

Instantly share code, notes, and snippets.

View diguinhorocks's full-sized avatar
🤘

Rodrigo Santiago Motta diguinhorocks

🤘
  • Itararé - São Paulo
View GitHub Profile
@diguinhorocks
diguinhorocks / form.html
Created February 17, 2012 17:54
Formulaŕio HTML com Borda
<!doctype html>
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<form class="form arredondada" action="" method="POST">
<input type="text" name="teste" />
<input type="submit" value=" Salvar " />
</form>
@diguinhorocks
diguinhorocks / Client.php
Created March 8, 2012 17:53
MongoDB Active Record (Basic)
<?php
include_once('MongoActiveRecord.php');
class Client extends MongoActiveRecord{
private $_id;
private $nome;
private $email;
private $senha;
@diguinhorocks
diguinhorocks / PaypalRequest.php
Created April 29, 2012 09:45
PaypalRequest Class (Express Checkout)
<?php
/**
*
* Paypal Request Class.
*
* Classe que adiciona os produtos e cria a requisição para a API Paypal utilizando o Express Checkout.
*
* @author R'Santiago.
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
@diguinhorocks
diguinhorocks / ModelGen.php
Created June 2, 2012 19:33
Library which generates some model stuff (attributes, magic getter, setter) for any application. Make sure the path to models is writable.
<?php
class ModelGen extends MysqlMapper{
protected $modelName;
protected $model = null;
protected $extends = 'extends MysqlActiveRecord';
@diguinhorocks
diguinhorocks / robot.js
Created December 5, 2012 23:57
r'santiago
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(300);
@diguinhorocks
diguinhorocks / Request.php
Last active September 20, 2019 16:07
Simple Google Custom Search API requester
<?php
class Request
{
protected $url;
protected $request;
protected $response;
protected $curl;
<?php
class Extension implements IFacExtension
{
public function add()
{
}
public function read()
{
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://npmjs.org/install.sh | sh
@diguinhorocks
diguinhorocks / user.js
Last active August 29, 2015 14:03
Mongoose User
/**
* Module dependencies.
*/
var mongoose = require('mongoose')
, Schema = mongoose.Schema
, crypto = require('crypto')
, _ = require('underscore')
, authTypes = ['github', 'twitter', 'facebook', 'google']
@diguinhorocks
diguinhorocks / chmod-400.cmd
Created June 5, 2020 08:48 — forked from jaskiratr/chmod-400.cmd
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r