Skip to content

Instantly share code, notes, and snippets.

View JoseCage's full-sized avatar
:octocat:
Opensourcing

José Cage JoseCage

:octocat:
Opensourcing
View GitHub Profile
@JoseCage
JoseCage / unused_routes.rb
Created January 27, 2022 10:05 — forked from strzibny/unused_routes.rb
Find unused routes in Rails
#!/usr/bin/env ruby
# Extracted from traceroute gem + checking the presence of views as well
require_relative './config/environment.rb'
class Traceroute
def initialize(app)
@app = app
end
@JoseCage
JoseCage / nginx.conf
Created October 3, 2021 22:02 — forked from rummykhan/nginx.conf
Nginx + Supervisor conf for Octane
server {
listen 80;
server_name app.rehanmanzoor.me;
charset utf-8;
client_max_body_size 1M;
location / {
proxy_pass http://127.0.0.1:8001;
proxy_http_version 1.1;
@JoseCage
JoseCage / Dockerfile
Created May 3, 2020 23:57 — forked from paulredmond/Dockerfile
A Dockerfile for a Laravel PHP Application with Caddy Server
FROM php:7.1-fpm
LABEL maintainer="Paul Redmond <paul@bitpress.io>"
# Install application dependencies
RUN curl --silent --show-error --fail --location \
--header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \
"https://caddyserver.com/download/linux/amd64?plugins=http.expires,http.realip&license=personal" \
| tar --no-same-owner -C /usr/bin/ -xz caddy \
&& chmod 0755 /usr/bin/caddy \
&& /usr/bin/caddy -version \
courses
- id (integer)
- name (string)
- short_description (text)
- description (text)
- price (float)
- course_time (string)
- start_at (date)
- end_at (date)
- teacher_id (integer)
@JoseCage
JoseCage / unfollow.js
Created December 12, 2019 13:40 — forked from JamieMason/unfollow.js.md
Unfollow everyone on twitter.com
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
// 1. Go to https://twitter.com/YOUR_USER_NAME/following
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 3. Paste this into the Developer Console and run it
(() => {
const followButtonQuery = '[data-testid$="-unfollow"]';
const confirmButtonQuery = '[data-testid="confirmationSheetConfirm"]';
const sleep = ({ seconds }) =>
<?php
use Illuminate\Database\Query\Builder;
Builder::macro('orderByNulls', function ($column, $direction = 'asc', $nulls = 'last', $bindings = []) {
$column = $this->getGrammar()->wrap($column);
$direction = strtolower($direction) === 'asc' ? 'asc' : 'desc';
$nulls = strtolower($nulls) === 'first' ? 'NULLS FIRST' : 'NULLS LAST';
return $this->orderByRaw("$column $direction $nulls", $bindings);
});
@JoseCage
JoseCage / GoogleApiAccess.md
Created May 12, 2019 10:46 — forked from lorisleiva/GoogleApiAccess.md
This gist describes two processes allowing us to access the Google API and to register some webhooks

Access Google API credentials and domain verification

This gist describes two processes allowing us to access the Google API and to register some webhooks. At the end of both processes we will obtain all variable needed to start using their API and we will have whitelisted all necessary URL to get started. We will be using the Google Calendar API and the Google Plus API to access the email address of the user.

This gist has been created as an Appendix to this article (part 1) and this article (part 3).

Note that, I will be using a randomly generated ngrok domain during this presentation. Simply replace b3093b51.ngrok.io with your domain name


@JoseCage
JoseCage / pure_html_css_modal.css
Created May 7, 2019 11:14 — forked from calebporzio/pure_html_css_modal.css
The CSS for the pure HTML/CSS modal I tweeted about.
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
import ballerina/http;
import ballerina/log;
import ballerina/io;
import ballerina/mysql;
// The expected fields we will get from DataLogger
// And i need to access from payload/request
// IMEI
// SIMN,
// DID;
@JoseCage
JoseCage / AttachJwtToken.php
Created February 21, 2019 13:58 — forked from whoisryosuke/AttachJwtToken.php
Laravel - Testing - Base class to extend basic API tests
<?php
namespace Tests\Traits;
use KushyApi\User;
trait AttachJwtToken
{
/**
* @var User