Skip to content

Instantly share code, notes, and snippets.

View pi3r0's full-sized avatar

pierreHouguet pi3r0

  • Cubyn
  • Paris
View GitHub Profile
@pi3r0
pi3r0 / secretSantaEngine.ts
Last active December 13, 2023 22:46
secretSantaEngine
const test = [
{ name: "0", email: "0@test.com" },
{ name: "1", email: "1@test.com" },
{ name: "2", email: "2@test.com" },
{ name: "3", email: "3@test.com" },
{ name: "4", email: "4@test.com" },
{ name: "5", email: "5@test.com" },
{ name: "6", email: "6@test.com" },
{ name: "7", email: "7@test.com" },
{ name: "8", email: "8@test.com" },
@pi3r0
pi3r0 / weather.js
Created September 4, 2019 12:13
Refactoring work - this a react component, working independently, this show weather forecast, at the refresh from the user location if user allowed this and via a search bar (inside the component) where you write a city name, then it fetches the result.
// Don't bother with import classes, this is not the problem here, you can add one if you have to.
// The goal is to refactor the functions (getWeather / getLocation) and inside the render() function.
// You can change state var or add one. things must be write once if it's possible and your code must be clear
// and understandable.
import React from "react";
import Form from "./Form";
import WeatherDiv from "./WeatherDiv";
import "./Form.css"
import "./WeatherAPi.css"
import Slider from "react-slick"
@pi3r0
pi3r0 / expected-weather.js
Last active September 2, 2019 12:27
Refactoring work - this a react component, working independently, this show weather forecast, at the refresh from the user location if user allowed this and via a search bar (inside the component) where you write a city name, then it fetches the result. Don't bother with import classes, this is not the problem here, you can add one if you have t…
import React from "react";
import Form from "./Form";
import WeatherDiv from "./WeatherDiv";
import "./Form.css"
import "./WeatherAPi.css"
import Slider from "react-slick"
import ActivityCards from "./ActivityCards"
import Activity from "./Activity.json"
import { Link } from 'react-router-dom'
@pi3r0
pi3r0 / WorkAfter-weather.js
Last active November 11, 2022 22:06
Asma work before her refactoring
import React from "react";
import Form from "./Form";
import WeatherDiv from "./WeatherDiv";
import "./Form.css"
import "./WeatherAPi.css"
import Slider from "react-slick"
import ActivityCards from "./ActivityCards"
import Activity from "./Activity.json"
import { Link } from 'react-router-dom'
@pi3r0
pi3r0 / Task 1
Created November 15, 2016 10:36
func solutionA(_ A : [[Int]]) -> Int {
var saddlePoints = 0;
for i in 1..<A.count - 1 {
for j in 1..<A[i].count - 1 {
let columnTest = [A[i][j-1], A[i][j], A[i][j+1]].sorted {$0 < $1};
let lignTest = [A[i-1][j], A[i][j], A[i+1][j]].sorted {$0 > $1};
if (columnTest.first! == A[i][j] && lignTest.first! == A[i][j]) {
print("Got it One \(A[i][j]) \(i) \(j) \n");
saddlePoints += 1 ;