Skip to content

Instantly share code, notes, and snippets.

View enimiste's full-sized avatar

NOUNI El bachir enimiste

View GitHub Profile
@enimiste
enimiste / WorldMeeting_Solution.java
Last active October 23, 2023 11:41
atCoder.jp problem : World Meeting Solution
import java.util.*;
import java.lang.*;
public class Main {
final static int S=9;
final static int E=18;
final static int D=24;
public static void main(final String[] args) throws Exception {
//Variables
//############## Bi-Directional ManyToMany JPA relationship #################################
class UsageCaseOne {
@Entity
class Foo {
@Id
private Long id;
@ManyToMany(mappedBy = "foos")
private Set<Bar> bars = new HashSet<>();
/*SELECT sum(t.tablename, c.column_name) AS total
FROM pg_catalog.pg_tables as t
join information_schema.columns as c on c.table_name=t.tablename and c.data_type='integer'
WHERE schemaname != 'pg_catalog' AND
schemaname != 'information_schema';*/
-- SELECT 0 AS total;
CREATE OR REPLACE FUNCTION pg_catalog.calcTotal ()
RETURNS BIGINT AS $$
@enimiste
enimiste / flowersgame.js
Created October 23, 2019 14:00
Flowers growing game using p5js library
function Flowers(flowers, ww, wh, initH, maxH, maxR) {
this.flowers = flowers;
this.size = flowers.length;
this.right = this.flowers[0];
this.left = this.flowers[this.size - 1];
this.windWidth = ww;
this.windHeight = wh;
this.initHeight = initH;
this.maxHeight = maxH;
this.maxR = maxR;
@enimiste
enimiste / composer.php.ini
Created December 24, 2018 20:47
Composer with different ini or with different PHP
[php]
memory_limit = -1
max_execution_time = 0
date.timezone = "Europe/Prague"
realpath_cache_size = "4096K"
[opcache]
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 256
@enimiste
enimiste / laravel5tips.md
Created October 25, 2017 13:00
Laravel 5 tips
mix.autoload({
    jquery: ['$', 'window.jQuery',"jQuery","window.$","jquery","window.jquery"]
});
//to put before mix.js in webpack.mix.js
//To put in the AppServiceProvider@boot function
\Schema::defaultStringLength(191)
@enimiste
enimiste / atom_clojure_setup.md
Created April 15, 2017 18:19 — forked from jasongilman/atom_clojure_setup.md
This describes how I setup Atom for Clojure Development.

Atom Clojure Setup

This describes how I setup Atom for an ideal Clojure development workflow. This fixes indentation on newlines, handles parentheses, etc. The keybinding settings for enter (in keymap.cson) are important to get proper newlines with indentation at the right level. There are other helpers in init.coffee and keymap.cson that are useful for cutting, copying, pasting, deleting, and indenting Lisp expressions.

Install Atom

Download Atom

The Atom documentation is excellent. It's highly worth reading the flight manual.

@enimiste
enimiste / Clojure-destructring-syntaxe.md
Created February 25, 2017 19:57
Clojure destructring syntaxe

Clojure destructring syntaxe :

==============================

Sequential :

+ On elements Seq like
+ Describing structure : Via a Vector
+ [item1 & rest] ==> reste is a list
+ [item1 _ item3] ==> _ to ignore this position
+ [[i1 i2]] ==> Nested destructring
  • [item1 ... :as v] ==> v represent the original seq
@enimiste
enimiste / nit_validation.js
Last active October 15, 2016 23:02
Twitter Bootstrap Tabs next-prev management with integration with ParsleyJs
/**
* Created by elbachirnouni on 15/10/2016.
*
* Depends on lodash.js 1.8.3, parsleyjs 2.5.0 and jQuery v2.1.4
*
*
* HOW TO USE IT :
* ---------------
* 1. ADD "data-tab-id" ATTRIBUTE IN EACH <a> OF YOUR .nav-tabs div. Give each one a integer id, ex : 1
* 2. ADD "nit-validation-elem" class to your tabs parent <div>.
@enimiste
enimiste / application.xml
Last active August 25, 2016 14:00
Prado Framwork project helper. Shortcut functions to most used features in Templates and Page classes : app(), request(), response(), redirect(), ...
<?xml version="1.0" encoding="utf-8"?>
<application id="site-starter-prado" mode="Debug">
<!--
add protected/config directory and create files :
- paths.xml
- modules.xml
- services.xml
- parameters.xml
-->