Skip to content

Instantly share code, notes, and snippets.

View rafaelkendrik's full-sized avatar

Rafael Kendrik rafaelkendrik

View GitHub Profile
import http from '@/http'
export const doLogin = (userInfo) => {
return http().get(`/sanctum/csrf-cookie`).then(() => {
return http().post(`/api/v1/common/login`, {
email: userInfo.email,
password: userInfo.password
}).then((response) => {
return response;
});
@bokwoon95
bokwoon95 / min-sane.sh
Last active May 21, 2020 10:43
minimal sane settings for .tmux.conf + .bashrc/.inputrc
echo "bind R source-file ~/.tmux.conf\\; display \"Reloaded!\"
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind e last-window
bind-key @ break-pane \\; last-window
bind-key S choose-window 'join-pane -v -s \"%%\"'
bind-key V choose-window 'join-pane -h -s \"%%\"'
set -sg escape-time 0
@digitalex
digitalex / removehtml
Last active January 13, 2023 08:50
Delete all HTML comments in VIM
%s/<!--\_.\{-}-->//g
@shinout
shinout / LICENSE
Created September 21, 2011 16:15
Topological sort in JavaScript
Copyright 2012 Shin Suzuki<shinout310@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
@kavalcante
kavalcante / estados.js
Last active July 13, 2023 05:09
Estados do Brasil em um Array - Javascript
states: [
{ 'AC': 'Acre' },
{ 'AL': 'Alagoas' },
{ 'AP': 'Amapá' },
{ 'AM': 'Amazonas' },
{ 'BA': 'Bahia' },
{ 'CE': 'Ceará' },
{ 'DF': 'Distrito Federal' },
{ 'ES': 'Espírito Santo' },
{ 'GO': 'Goías' },
@weaming
weaming / boostnote2md.py
Last active August 7, 2023 09:51
Convert boostnote cson format data to markdown
#!/usr/bin/env python3
# coding: utf-8
"""
Author : weaming
Created Time : 2018-05-26 21:32:59
Prerequisite:
python3 -m pip install cson arrow
"""
import json
import os
@crtr0
crtr0 / client.js
Created June 8, 2012 17:02
A simple example of setting-up dynamic "rooms" for socket.io clients to join
// set-up a connection between the client and the server
var socket = io.connect();
// let's assume that the client page, once rendered, knows what room it wants to join
var room = "abc123";
socket.on('connect', function() {
// Connected, let's sign-up for to receive messages for this room
socket.emit('room', room);
});
@balupton
balupton / cors.js
Created September 11, 2012 05:21
Acheiving CORS via a Node HTTP Server
// Create our server
var server;
server = http.createServer(function(req,res){
// Set CORS headers
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Request-Method', '*');
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
res.setHeader('Access-Control-Allow-Headers', '*');
if ( req.method === 'OPTIONS' ) {
res.writeHead(200);
anonymous
anonymous / untitled
Created April 27, 2015 13:44
IFTTT Spotify Alarm Clock
Spotify Alarm
Utilizing [IFTT recipe](https://ifttt.com/recipes/283707-spotify-alarm-clock)
In your mail client:
Create a rule in your mail client with the following properties
- Message content contains #wakeup
- Actions: Delete Message, Run AppleScript
Create an AppleScript with the following statements.
@Prezens
Prezens / gist:f99fd28124b5557eb16816229391afee
Created April 2, 2019 07:40
Apache .htaccess settings for Vue, vue-router
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.html$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</IfModule>
https://router.vuejs.org/guide/essentials/history-mode.html#example-server-configurations