Skip to content

Instantly share code, notes, and snippets.

View raulp's full-sized avatar
🎯
Focusing

Raul raulp

🎯
Focusing
  • San Diego
  • 04:12 (UTC -08:00)
View GitHub Profile
@raulp
raulp / claude.md
Created August 8, 2025 15:49 — forked from DanielCoulbourne/claude.md
Claude

Style

  • Don't use too many comments unless there is something non-obvious going on.
  • In general, use DTOs over arrays of data when consuming data from APIs. Saloon has first-party support for casting responses to DTOs, if you need help understanding it, check their documentation.
  • When implementing DTOs, use the simplest approach that works - plain PHP objects are often sufficient.
  • Follow existing code formatting and naming conventions in the project.
  • Check if the project has a code formatter/linter and use it before submitting changes.

Acceptance criteria

  • If you are building a new feature or refactoring, be absolutely certain to run the tests before telling me you are done.
  • When the tests relating to your feature are passing, make sure to also run the entire test suite to ensure you didn't break other tests.
server {
listen 80;
server_name mydomain.com;
root /home/forge/mydomain.com/public;
# FORGE SSL (DO NOT REMOVE!)
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
index index.html index.htm index.php;
server {
server_name ...;
listen ...;
location /one {
root /home/app/laravel1/public;
....
}
location /two {
root /home/app/laravel2/public;
....
stdClass Object
(
[type] => 1
[encoding] => 0
[ifsubtype] => 1
[subtype] => REPORT
[ifdescription] => 0
[ifid] => 0
[ifdisposition] => 0
[ifdparameters] => 0
<script src="http://localhost:3000/socket.io/socket.io.js"></script>
<script>
var news = io.connect('http://localhost:3000/news');
news.on('connect', function(socket) {
news.emit("raul", new Array("1","2","3","4","5","6","7","8","9","10") );
news.on('get_random_number_from_raul', function(data) {
console.log(data);
});
var io = require('socket.io').listen(3000);
var news = io.of('/news').on('connection', function (socket) {
socket.on('raul', function(data){
var rand = data[Math.floor(Math.random() * data.length)];
news.emit("get_random_number_from_raul", rand);
});
socket.on("createroom", function(room) {
socket.join(room);
console.log(socket);
@raulp
raulp / l4-queue-push-ret-id
Last active May 19, 2017 20:51
Laravel Queue::push return job id
// For IronIO
// file src/Illuminate/Queue/IronQueue.php line 64
public function push($job, $data = '', $queue = null)
{
$payload = $this->createPayload($job, $data);
$response = $this->iron->postMessage($this->getQueue($queue), $payload);
return $response->id;
}