Skip to content

Instantly share code, notes, and snippets.

View recca0120's full-sized avatar
💭
Looking for a job

Recca Tsai recca0120

💭
Looking for a job
View GitHub Profile
@recca0120
recca0120 / notes.md
Created August 28, 2018 17:18 — forked from inecmc/notes.md
How to run multiple Redis instances on Ubuntu 16.04

Create the directory for the new instance

$ sudo install -o redis -g redis -d /var/lib/redis2

Create a new configuration file

$ sudo cp -p /etc/redis/redis.conf /etc/redis/redis2.conf
@recca0120
recca0120 / BadEgg.php
Last active August 10, 2018 09:01
聖佑愛吃蛋
<?php
class BadEgg implements Egg
{
public function eaten()
{
return 'Unsatisfy';
}
}
@recca0120
recca0120 / .zshrc
Created July 5, 2018 06:47 — forked from vocolboy/install.md
pretty zsh ( iTerm2 , Zsh , Oh My Zsh , Powerlevel9K )
DEFAULT_USER=$USER
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
PATH=$PATH:/usr/local/sbin
# Path to your oh-my-zsh installation.
export ZSH=/Users/$USER/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
@recca0120
recca0120 / Cloudflare.php
Last active January 9, 2022 06:08
Cloudflare.php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Routing\UrlGenerator;
use Illuminate\Http\RedirectResponse;
class Cloudflare
@recca0120
recca0120 / ForceJson.php
Last active June 5, 2018 06:09
Laravel ForceJson
<?php
namespace App\Http\Middleware;
use Closure;
class ForceJson
{
/**
* Handle an incoming request.
@recca0120
recca0120 / Facebook.js
Created June 22, 2017 05:10
Facebook Promise Wrapper
'use strict';
export class Facebook {
getScript() {
return new Promise((resolve) => {
if (window.FB) {
resolve(window.FB);
}
const id = 'facebook-jssdk';
@recca0120
recca0120 / Flunt.php
Last active June 14, 2017 04:07
Flunt API
<?php
class Fluent
{
protected $messages = [];
public function hello()
{
$this->messages[] = 'hello';
<?php
namespace App\Http\Middleware;
use Closure;
use Exception;
use Ramsey\Uuid\Uuid;
class RequestId
{
@recca0120
recca0120 / Session.php
Last active May 3, 2017 16:52
簡單的 session 類別實現
interface SessionInterface {
public function start();
public function set($key, $value);
public function get($key, $default = null);
public function remove($key);
public function all();
}
class NativeSession implemenet SessionInterface {
public function start() {
'use babel';
import groupBy from 'lodash/groupBy';
import forEach from 'lodash/forEach';
import axios from 'axios';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import 'rxjs/add/observable/fromPromise';
import 'rxjs/add/observable/fromEvent';
import 'rxjs/add/operator/map';