Skip to content

Instantly share code, notes, and snippets.

View Yuri-M-Dias's full-sized avatar
🛰️
Off to space

Yuri Dias Yuri-M-Dias

🛰️
Off to space
  • Brazil
View GitHub Profile
@primaryobjects
primaryobjects / domain-grammar.txt
Last active August 23, 2022 14:45
Attempt at a basic STRIPS PDDL grammar parser for pegjs.org. To use, visit http://pegjs.org/online and paste the below grammar into the left-side window. In the right-side window, paste a PDDL domain file, such as https://spark-public.s3.amazonaws.com/aiplan/resources/random-domain.txt. The output will display in the Output panel.
/*STRIPS PDDL parser for http://pegjs.org/online
For example of parsing this grammar, see https://gist.github.com/primaryobjects/1d2f7ee668b62ca99095
Example PDDL domain to parse:
(define (domain random-domain)
(:requirements :strips)
(:action op1
:parameters (?x1 ?x2 ?x3)
:precondition (and (S ?x1 ?x2) (R ?x3 ?x1))
:effect (and (S ?x2 ?x1) (S ?x1 ?x3) (not (R ?x3 ?x1))))
@ansell
ansell / install-java.sh
Last active April 20, 2024 01:36
Ubuntu 18.04-Mint 18 installations for Java Maven Eclipse Kotlin Gradle
#!/bin/sh
# Install Java-8
#sudo add-apt-repository ppa:webupd8team/java -y
#sudo apt-get update
#echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
#echo oracle-java9-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
#sudo apt-get install oracle-java8-installer oracle-java9-installer oracle-java9-set-default
sudo apt-get install openjdk-8-jdk
@darekkay
darekkay / intellij-monokai-theme.xml
Last active February 19, 2025 03:01
Monokai Theme for JetBrains IDEs (IntelliJ IDEA, Webstorm, PhpStorm, PyCharm etc.)
<scheme name="Eclectide Monokai" version="142" parent_scheme="Default">
<colors>
<option name="ADDED_LINES_COLOR" value="295622" />
<option name="ANNOTATIONS_COLOR" value="b2c0c6" />
<option name="CARET_COLOR" value="bbbbbb" />
<option name="CARET_ROW_COLOR" value="" />
<option name="CONSOLE_BACKGROUND_KEY" value="1c1c1c" />
<option name="FILESTATUS_ADDED" value="629755" />
<option name="FILESTATUS_DELETED" value="6c6c6c" />
<option name="FILESTATUS_IDEA_FILESTATUS_DELETED_FROM_FILE_SYSTEM" value="6c6c6c" />
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@jish
jish / promise.js
Created October 28, 2014 22:35
An example "always" behavior for ES6 promises. This only works if you do not create / return intermediate promises.
// A thing I want to do
// This flow only involves **one** promise, for example an ajax call
// None of the subsequent `then` or `catch` calls, return new promises.
var explode = false;
var promise = new Promise(function(resolve, reject) {
if (explode) {
@maykondeykon
maykondeykon / cnpjValidator
Last active September 18, 2015 15:34
Função para validação de CNPJ usando o plugin JQuery Bootstrap Validator.
/**
* Função para validar CNPJ usando bootstrapvalidator
* Baseado na função para validação de CPF encontrada em:
* https://github.com/nghuuphuoc/bootstrapvalidator/issues/187
* usando a implementação da validação para CNPJ encontrada em:
* http://www.fernandowobeto.com/blog/plugin-jquery-validacao-cnpj/
*
*/
(function(e) {
e.fn.bootstrapValidator.validators.cnpjVal = {
@LeCoupa
LeCoupa / bash-cheatsheet.sh
Last active April 19, 2025 04:38
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@sararob
sararob / data-structure.js
Last active April 26, 2022 22:21
Role-based security in Firebase
/*
This example shows how you can use your data structure as a basis for
your Firebase security rules to implement role-based security. We store
each user by their Twitter uid, and use the following simplistic approach
for user roles:
0 - GUEST
10 - USER
20 - MODERATOR
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #