Skip to content

Instantly share code, notes, and snippets.

View deivide's full-sized avatar

Deivide Vian deivide

  • Itaipulândia - Paraná - Brasil
  • X @DElVlDE
View GitHub Profile
@renatomefi
renatomefi / gen-jwt-rsa-keys.sh
Last active May 28, 2019 08:29
Generate RS256 JWT keys to use at jwt.io
#!/bin/bash
# This will write private.pem and public.pem in the current directory
# The default key strenght is 2048 bits
# usage:
# # ./gen-jwt-rsa-keys.sh mykey
# # ls
# gen-jwt-rsa-keys.sh mykey-private.key mykey-public.pem
# first time you have to give execution permission or use bash and the filename
# # chmod +x gen-jwt-rsa-keys.sh
KEYNAME=${1:-jwtrsa}
@heyost
heyost / httpd-vhosts.conf
Last active April 29, 2022 13:37
Create dynamic Laravel project vhost on Arch Linux
# Custom vhost laravel wildcard
# enable vhost_alias_module first on httpd.conf
<VirtualHost *:80>
ServerAdmin webmaster@laravel.dev
ServerName laravel.dev
ServerAlias *.laravel.dev
# This will be the wildcarded document root. Any folder you create in /srv/http/php/laravel/* will be automatically a subdomain name.
VirtualDocumentRoot /srv/http/php/laravel/%-3/public
/*
EXAMPLE MESSAGE
/poll "question?" "option 1" "option 2"
*/
/** Global Helpers
*
* console - A normal console instance
* _ - An underscore instance
@mozillazg
mozillazg / supervisord.service
Last active December 1, 2023 12:59 — forked from tonyseek/supervisord.service
install and configure supervisord on centos 7.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown
@jampajeen
jampajeen / LC_CTYPE.txt
Created November 21, 2015 13:02
Centos warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
vi /etc/environment
add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@ygotthilf
ygotthilf / jwtRS256.sh
Last active July 25, 2024 16:15
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
<?php
class MatchesControllerTest extends TestCase
{
protected $user;
protected $profile;
public function setUp()
{
parent::setUp();
DB::beginTransaction();
@CMCDragonkai
CMCDragonkai / angularjs_directive_attribute_explanation.md
Last active November 29, 2023 15:35
JS: AngularJS Directive Attribute Binding Explanation

AngularJS Directive Attribute Binding Explanation

When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.

  1. Raw Attribute Strings

    <div my-directive="some string" another-param="another string"></div>
@clouddueling
clouddueling / controller.php
Created March 26, 2013 02:07
Long pulling in php with Laravel
public function get_checkin_poll()
{
$filepath = 'storage/work/checkin_poll_' . Auth::user()->id;
$last_cycle = File::get($filepath);
$break = false;
$thread = uniqid();
// if last cycle was > 60 secs continue
@JeffreyWay
JeffreyWay / laravel.js
Last active April 6, 2024 20:12
Want to send a DELETE request when outside of a form? This will handle the form-creation bits for you dynamically, similar to the Rails implementation. (Requires jQuery, but doesn't have to.) To use, import script, and create a link with the `data-method="DELETE"` attribute.
/*
<a href="posts/2" data-method="delete"> <---- We want to send an HTTP DELETE request
- Or, request confirmation in the process -
<a href="posts/2" data-method="delete" data-confirm="Are you sure?">
*/
(function() {