This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"eslintConfig": { | |
"extends": ["react-app", "airbnb"], | |
"settings": { | |
"import/resolver": { | |
"node": { | |
"paths": ["src"], | |
"extensions": [".js", ".jsx", ".ts", ".tsx"] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
..., | |
"baseUrl": "src" | |
}, | |
"include": [ | |
"src" | |
] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ContentWrapper from 'Components/ContentWrapper' | |
const SampleComponent = () => { | |
return ( | |
<ContentWrapper | |
style={{ | |
width: '100%', | |
padding: '20px 10px', | |
marginBottom: '10px' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ContentWrapper from '../../../../Components/ContentWrapper' | |
const SampleComponent = () => { | |
return ( | |
<ContentWrapper | |
style={{ | |
width: '100%', | |
padding: '20px 10px', | |
marginBottom: '10px' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"compilerOptions": { | |
"baseUrl": "src" | |
}, | |
"include": ["src"] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HooksController < ApplicationController | |
def handle_webhook | |
payload = request.body.read | |
sig_header = request.headers["X-Hub-Signature"] | |
sig_header.slice! "sha1=" | |
app_secret = Figaro.env.FB_APP_SECRET | |
sign = get_sha_sign(payload, app_secret) | |
if sign != sig_header | |
raise BaseError::InvalidRequest.new("Invalid Signature") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"short_name": "BgColor Change", | |
"name": "Change background color", | |
"version": "1.0.0", | |
"manifest_version": 2, | |
"permissions": [ | |
"storage", | |
"tabs", | |
"activeTab", | |
"http://*/*", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*global chrome*/ | |
export async function changeColor() { | |
chrome.storage.sync.set({color: "#3aa757"}, ()=>{}); | |
await chrome.tabs.query({active: true, currentWindow: true}, | |
( | |
r => { | |
chrome.tabs.executeScript(r[0].id , {file: 'scripts/changeBgColor.js'}, function() { | |
if(chrome.runtime.lastError) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import './App.css'; | |
import { changeColor } from './main'; | |
function App() { | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<button onClick={changeColor}> | |
Change color | |
</button> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Userapi | |
class Application < Rails::Application | |
#... | |
#Rails 3/4 | |
config.middleware.insert_before 0, "Rack::Cors" do | |
allow do | |
origins '*' | |
resource '*', :headers => :any, :methods => [:get, :post, :options] |