View basic_operators_rewrite.js
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
const and = (...args) => args.every(x => x) | |
const and = (a, b) => !!(!!(a || b) ^ !!a ^ !!b) | |
const and = (...args) => args.reduce((a, b) => !!(!!(a || b) ^ !!a ^ !!b), true) | |
const and = (...args) => args.length ? args.shift() ? and(...args) : false : true | |
const or = (...args) => args.some(x => x) |
View data.js
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
var imgNotSet = "//3.bp.blogspot.com/-Rs07YEwFur0/WAefWDtX_wI/AAAAAAABpZA/srKBCUrVz4Eh6RMUtTaeLs47d1MZuu_ywCLcB/s1600/aten%25C3%25A7%25C3%25A3o%2521.gif"; | |
function MyInfo() { | |
this.updated = "19/10/2016"; | |
this.banner = imgNotSet; | |
this.theCatgs = []; | |
this.sortInfo = function(sortBy = null) { | |
if (sortBy) { | |
} else { |
View build.js
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
if (process.argv[2] == undefined) process.exit(0); | |
if (process.argv[2] == "") process.exit(0); | |
const { pkg_fetch_version, node_version, pkg_cache_path, icon, version, description, company, name, copyright, file } = require(`./${process.argv[2]}.json`); | |
const ResEdit = require('resedit'); | |
const { DownloaderHelper } = require('node-downloader-helper'); | |
const path = require("path"); | |
const fs = require('fs'); | |
process.env['PKG_CACHE_PATH'] = path.join(__dirname, pkg_cache_path); | |
const pkg_fetch = path.join(process.env['PKG_CACHE_PATH'], `v${pkg_fetch_version}`); | |
const fetched = path.join(pkg_fetch, `fetched-v${node_version}-win-x64`); |
View gist:00dd85a3a13e4fcb9bea3b1f0e7ac142
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
// This is the outside in approach, where the parent process is not within Docker, but the child lives in a docker image. | |
var externalNodeProcess = require('child_process').spawn('docker', [ | |
'run', | |
'-a', 'stdin', '-a', 'stdout', '-a','stderr', | |
'-i', | |
'image/name:tag', | |
'node','index.js' | |
], { | |
stdio: ['pipe', 'pipe', 'pipe'] |
View index.html
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Crunker example</title> | |
<script src="https://unpkg.com/crunker@0.4.0/dist/crunker.js" ></script> | |
<style> | |
form { | |
display: flex; |
View index.js
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
const functions = require('firebase-functions'); | |
var admin = require("firebase-admin"); | |
const cookieParser = require('cookie-parser'); | |
const crypto = require('crypto'); | |
var serviceAccount = require("./service-account.json"); | |
const APP_NAME = "twitch-playground"; | |
admin.initializeApp({ | |
credential: admin.credential.cert(serviceAccount), |
View Masonry.jsx
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 React, { useEffect } from "react"; | |
import ReactDOM from 'react-dom'; | |
import { useRefCallback } from "../utils"; | |
export default function MasonryPage({children, numCols = 2}) { | |
const [masonryRef, setMasonryRef] = useRefCallback() | |
useEffect(() => { | |
const colHeights = Array(numCols).fill(0) | |
const container = ReactDOM.findDOMNode(masonryRef.current) |
View farm_data_all.json
This file has been truncated, but you can view the full file.
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
View key_codes.js
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
const keyCodes = { | |
0: 'That key has no keycode', | |
3: 'break', | |
8: 'backspace / delete', | |
9: 'tab', | |
12: 'clear', | |
13: 'enter', | |
16: 'shift', | |
17: 'ctrl', | |
18: 'alt', |
View busy_cop-mapa1.pl
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
% Trabalho de Inteligência Artificial - Projeto 1 (BCC/UFSCar/2018) | |
% Autor: Alisson Nunes (R.A.: 725862) | |
:- write_ln('[MAPA 1 CARREGADO]'). | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
ladrao([10, 5]) :- !. | |
policial([10, 1]) :- !. |
NewerOlder