Skip to content

Instantly share code, notes, and snippets.

View diegonobre's full-sized avatar

Diego Nobre diegonobre

View GitHub Profile
@diegonobre
diegonobre / package.json
Created July 28, 2021 17:54
Strapi.io FE + BE package.json npm-run-all wait-on cross-env
{
"name": "project.name",
"private": true,
"version": "0.0.0",
"scripts": {
"develop:backend": "yarn --cwd backend develop",
"develop:frontend": "wait-on http://localhost:1337/admin && yarn --cwd frontend develop",
"develop": "cross-env FORCE_COLOR=1 npm-run-all -l -p develop:*",
"heroku-prebuild": "cd backend && yarn",
"start": "cd backend && yarn start"
@butlerblog
butlerblog / my_get_plugin_info.php
Last active September 20, 2022 20:05
#utility to get plugin info
<?php // no need to use this line.
/**
* Utility to get information on installed plugins.
*
* Returns an array of all installed plugins and indicates which are
* plugin are active and which are not. Array is keyed by the plugin's
* folder/slug.php (which is how WP looks at them) and includes the
* name, version, and true/false whether it is active or not.
*
@lixingcong
lixingcong / curl-head.php
Created November 11, 2017 01:57
php-curl send HEAD request
<?php
// https://stackoverflow.com/questions/1545432/what-is-the-easiest-way-to-use-the-head-command-of-http-in-php
$dst_url='http://qq.com/';
// create a new cURL resource
$ch = curl_init();
// set URL and other appropriate options
@heathdutton
heathdutton / upgrade-php7.sh
Last active January 12, 2024 07:47
Upgrade PHP to 7.3 on Amazon Linux (specifically for Elastic Beanstalk but should work elsewhere)
#!/usr/bin/env bash
# Upgrade an Amazon Linux EC2 to PHP 7.3
#
# Last tested w/ PHP 7.2 AWS Linux version 2.8.5
#
# Must be ran as sudo:
# sudo bash upgrade-php7.sh
#
# Can be added to ./.ebextensions/20_php.config like so:
# container_commands:
@d1i1m1o1n
d1i1m1o1n / text
Created October 6, 2016 12:16
How to disable auto-save in phpstorm
How to disable auto-save:
Go to File > Settings (Ctrl+Alt+S).
Go to Appearance & Behavior > System Settings.
Make sure the two are unchecked:
Save files on frame deactivation
Save files automatically if application is idle for x sec.
Go to Editor > General > Editor Tabs
Put a checkmark on "Mark modified files with asterisk"
(Optional but recommended) Under "Tab Closing Policy", select "Close non-modified files first". You may also want to increase the number of allowed tabs.
Click Apply > OK.
@leonardofed
leonardofed / README.md
Last active April 24, 2024 01:47
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@tjamps
tjamps / README.md
Last active February 29, 2024 14:57
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :

@inooid
inooid / .bash_profile
Created March 16, 2015 09:34
Google command to search on Google from the command line (Mac OS X)
# Command to open the webbrowser and immediately start searching
# for the right keyword.
#
# Usage:
# $ google test query
# $ => Opens the browser on http://www.google.com/search?q=test+query
#
google()
{
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git