$ npm install -g create-react-app
$ create-react-app my-app
This file contains hidden or 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
#!/bin/bash | |
# set values for certificate DNs | |
# note: CN is set to different values in the sections below | |
ORG="000_Test_Certificates" | |
# set values that the commands will share | |
VALID_DAYS=360 | |
CA_KEY=ca.key | |
CA_CERT=ca.crt |
This file contains hidden or 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
# project-repo/app/settings/.env-example | |
# | |
# DJANGO | |
# | |
SITE_HOST=localhost:8000 | |
USE_SSL=False | |
ALLOWED_HOSTS=localhost,127.0.0.1 | |
SECRET_KEY=asdasd | |
DEBUG=true # never on production, will cause settings including api keys to leak | |
DJANGO_LOG_LEVEL=DEBUG |
This file contains hidden or 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
async function skipTo() { | |
try { | |
await TrackPlayer.skip("2"); | |
await TrackPlayer.play(); | |
} catch (_) {} | |
} |
This file contains hidden or 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
from aiohttp import web | |
from threading import Thread | |
import asyncio | |
import time, uuid | |
loop = asyncio.get_event_loop() | |
def long_blocking_thing(sleep): | |
time.sleep(sleep) | |
return 42 |
This file contains hidden or 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
settings.xml | |
<?xml version="1.0" encoding="UTF-8"?> | |
<odoo> | |
<data> | |
<record id="res_config_settings_google_map_view_form" model="ir.ui.view"> | |
<field name="name">Google Map Settings</field> | |
<field name="priority" eval="200"/> | |
<field name="model">res.config.settings</field> | |
<field name="inherit_id" ref="base_setup.res_config_settings_view_form"/> | |
<field name="arch" type="xml"> |
This file contains hidden or 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
upstream socket { | |
ip_hash; | |
server 127.0.0.1:8000 fail_timeout=0; | |
} | |
server { | |
server_name freelancescanner.com; | |
access_log /var/log/nginx/freelancescanner.access.log; | |
error_log /var/log/nginx/freelancescanner.error.log; | |
location / { |
This file contains hidden or 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
version: '2' | |
services: | |
db: | |
image: postgres:9.4 | |
restart: always | |
environment: | |
- POSTGRES_USER=odoo | |
- POSTGRES_PASSWORD=odoo | |
odoo: | |
image: odoo:11 |
This file contains hidden or 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
from odoo import models, fields | |
from math import sqrt | |
def get_distance(place1, place2): | |
distance = sqrt((place1.latitude - place2.latitude)**2 + (place1.longitude - place2.longitude)**2) * 111 | |
return distance | |
class Location(models.Model): |
This file contains hidden or 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
odoo.define('parking_map_widget', function (require) { | |
"use strict"; | |
var Widget = require("web.Widget"); | |
var widgetRegistry = require("web.widget_registry"); | |
var ajax = require('web.ajax'); | |
var setGoogleMap = () => { | |
var script = document.createElement("script"); | |
script.id = "gmap_script"; |
OlderNewer