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
/** | |
* API providing 2 way binding of JavaScript objects to browser LocalStorage | |
* | |
* @type {Object} | |
*/ | |
/** | |
* Constructor for creating an object of LocalStorageObject type | |
* | |
* @param {object} target object or array defining object properties |
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
git checkout --orphan <branch-name> | |
git reset | |
rm -rf * | |
# now you have no history and no files, like a true orphan ;) |
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
const path = require('path'); | |
const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin') | |
const CleanWebpackPlugin = require('clean-webpack-plugin') | |
const CopyWebpackPlugin = require('copy-webpack-plugin') | |
module.exports = env => { | |
isProduction = env.production || false |
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
var BrowserEnum = Object.freeze({ | |
chrome: 'CHROME_BROWSER', | |
firefox: 'FIREFOX_BROWSER', | |
opera: 'OPERA_BROWSER', | |
safari: 'SAFARI_BROWSER', | |
ie: 'SHIT_BROWSER', | |
edge: 'EDGE_BROWSER' | |
}); | |
var whichBrowser = function() { |
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
# https://stackoverflow.com/a/1115909 | |
function swap() | |
{ | |
local TMPFILE=tmp.$$ | |
mv "$1" $TMPFILE && mv "$2" "$1" && mv $TMPFILE $2 | |
} |
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
const jsonServer = require('json-server'); | |
const server = jsonServer.create(); | |
const path = require('path'); | |
const router = jsonServer.router(path.join(__dirname, 'db.json')); | |
const middlewares = jsonServer.defaults(); | |
// define primary key columns for each resource | |
const primaryKeys = { | |
"countries": "code", | |
"towns": "id", |
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
POST /push - subscribe user by user_id with device_token | |
param: device_token: String | |
param: user_id: Int | |
Authorization: token: String - user Auth token | |
returns: | |
{ | |
... | |
data: { | |
user_id: Int, |
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
<?xml version="1.0"?> | |
<rdf:RDF xmlns="http://www.semanticweb.org/javert/ontologies/2017/10/dungeons-and-dragons#" | |
xml:base="http://www.semanticweb.org/javert/ontologies/2017/10/dungeons-and-dragons" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:owl="http://www.w3.org/2002/07/owl#" | |
xmlns:xml="http://www.w3.org/XML/1998/namespace" | |
xmlns:xsd="http://www.w3.org/2001/XMLSchema#" | |
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> | |
<owl:Ontology rdf:about="http://www.semanticweb.org/javert/ontologies/2017/10/dungeons-and-dragons"/> | |
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
# all Items that belong to Characters | |
PREFIX rpg: <http://www.semanticweb.org/javert/ontologies/2017/10/dungeons-and-dragons#> | |
SELECT ?Character ?Item | |
WHERE { ?Character rpg:hasItem ?Item } | |
# all Characters that know Healing Spells | |
PREFIX rpg: <http://www.semanticweb.org/javert/ontologies/2017/10/dungeons-and-dragons#> | |
SELECT ?Character ?Spell | |
WHERE { ?Character rpg:knowsSpell ?Spell . | |
?Spell rdf:type rpg:Healing } |