Skip to content

Instantly share code, notes, and snippets.

View EricCote's full-sized avatar

Eric Cote EricCote

View GitHub Profile
@EricCote
EricCote / preference
Created March 28, 2024 19:42
google config
"default_search_provider": {
"synced_guid": "9DF246DB-4501-4E1D-B1AB-F219CD1332AB"
},
"default_search_provider_data": {
"template_url_data": {
"alternate_urls": [
"{google:baseURL}#q={searchTerms}",
"{google:baseURL}search#q={searchTerms}",
"{google:baseURL}webhp#q={searchTerms}",
"{google:baseURL}s#q={searchTerms}",
@EricCote
EricCote / page1.tsx
Last active April 21, 2023 20:02
Projet avril 2023
import { useEffect, useState } from 'react';
import { Movie } from '../marvel/common/MovieInterface';
/*
intégré au navigateur
1. XmlHttpRequest (xhr Ajax)
2. Fetch API (promise based)
Librairies externes:
1. jQuery (ajax)
@EricCote
EricCote / TableCovid.jsx
Created February 16, 2022 16:52
Projet qui affiche la covid
import React from "react";
import { Table } from "react-bootstrap";
function TableCovid({ liste }) {
return (
<Table>
<thead>
<tr>
<th>Pays</th>
<th>Cas total</th>
@EricCote
EricCote / menu.jsx
Created February 16, 2022 15:15
Application de react
import React from "react";
import { Container, Nav, Navbar, NavDropdown } from "react-bootstrap";
function Menu() {
return (
<Navbar bg="light" expand="lg">
<Container>
<Navbar.Brand href="#home">React-Bootstrap</Navbar.Brand>
<Navbar.Toggle aria-controls="basic-navbar-nav" />
<Navbar.Collapse id="basic-navbar-nav">
@EricCote
EricCote / SendCommand.sql
Last active January 19, 2022 21:35
Executer des commandes sql vers de multiples Bases de Donnes en destination
CREATE PROCEDURE ExecuteInMultipleDataBase
@cmd nvarchar(1000)
AS
declare @databases table (
name nvarchar(100)
);
INSERT INTO @databases (name) Values
('AdventureWorks'),('InternetSales');
$edgeEnterpriseMSIUri = 'https://edgeupdates.microsoft.com/api/products?view=enterprise'
$response = Invoke-WebRequest -Uri $edgeEnterpriseMSIUri -Method Get -ContentType "application/json" -UseBasicParsing -ErrorVariable InvokeWebRequestError
$jsonObj = ConvertFrom-Json $([String]::new($response.Content))
$selectedIndex = [array]::indexof($jsonObj.Product, "Stable")
$LatestEdgeUrl = ($jsonObj[$selectedIndex].Releases |
Where-Object { $_.Architecture -eq "x64" -and $_.Platform -eq "Windows"} |
@EricCote
EricCote / install_windows_terminal.ps1
Last active June 16, 2020 12:20
install Windows terminal from the command line
curl https://github.com/microsoft/terminal/releases/download/v1.0.1401.0/Microsoft.WindowsTerminal_1.0.1401.0_8wekyb3d8bbwe.msixbundle --output terminal.msixbundle -L
.\terminal.msixbundle
@EricCote
EricCote / Restore.sql
Created September 25, 2018 20:17
Sql Database Adventure Works LT 2016 Restore
--SELECT * FROM Sys.Databases
--DROP DATABASE [C:\DEMO\ADVENTUREWORKS_DATA.MDF]
-- https://github.com/Microsoft/sql-server-samples/releases/download/adventureworks/AdventureWorksLT2016.bak
RESTORE DATABASE AdventureWorksLT2016
FROM DISK='C:\Users\eric\Downloads\AdventureWorksLT2016.bak'
WITH
MOVE 'AdventureWorksLT2012_data' TO 'C:\Data\AdventureWorksLT_data.mdf',
MOVE 'AdventureWorksLT2012_log' TO 'C:\Data\AdventureWorksLT_log.mdf'
@EricCote
EricCote / AuthorApi.js
Last active June 14, 2018 20:32
script pour React Academy
import { authors } from './authorData'
import _ from 'lodash'
//This file is mocking a web API by hitting hard coded data.
// var authors = require('./authorData').authors;
// var _ = require('lodash');
//This would be performed on the server in a real app. Just stubbing in.
USE [master];
CREATE DATABASE AdventureWorks_Snapshot_1nov2017
ON ( NAME = N'AdventureWorks',
FILENAME = N't:\snap.mdf' )
AS SNAPSHOT OF AdventureWorks;
GO
-------------------------------------