A Glue for React and Airbnb/Polyglot.js
This is a glue for react and Airbnb polyglot.
Why make polyglot in every component? Simply. Because of Component in atomic level should be stateless. (without flux).
<?php namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Contracts\Routing\Middleware; | |
use Illuminate\Http\Response; | |
class CORS implements Middleware { | |
/** | |
* Handle an incoming request. |
# virtualenv auto activation | |
function cd { | |
builtin cd "$@" | |
DEACTIVATE_TYPE="function"; | |
DEACTIVATE_EXIST=$(type -t deactivate); | |
if [ -d ".venv" ] | |
then | |
source .venv/bin/activate #auto activate | |
else | |
if [ "$DEACTIVATE_EXIST" == "$DEACTIVATE_TYPE" ]; then deactivate; fi #auto deactivate |
#!/bin/bash | |
# Thanks to https://gist.github.com/wenzhixin/43cf3ce909c24948c6e7 | |
# Execute this script in your home directory. Lines 17 and 21 will prompt you for a y/n | |
# Install Oracle JDK 8 | |
add-apt-repository ppa:webupd8team/java | |
apt-get update | |
apt-get install -y oracle-java8-installer | |
apt-get install -y unzip make # NDK stuff |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0 | |
REACT_NATIVE_APP_NAME="Your App Name" |
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
const cluster = require('cluster'); | |
const http = require('http'); | |
const numCPUs = require('os').cpus().length; | |
const express = require('express'); | |
const loki = require('lokijs'); | |
var app = express(); | |
var db = new loki('test'); | |
#!/bin/bash | |
notify() { | |
user_id=<your tele id> | |
bot_token=<your tele bot token> | |
message=$1 | |
curl --data chat_id="${user_id}" \ | |
--data "text=${message}" \ | |
"https://api.telegram.org/bot${bot_token}/sendMessage" | |
} |
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
class BrowseController extends Controller | |
{ | |
// dattable cacher |