Skip to content

Instantly share code, notes, and snippets.

View StephaneTy-Pro's full-sized avatar

StephaneTy-Pro

  • France - Northern France - Lille/Tourcoing
View GitHub Profile
@StephaneTy-Pro
StephaneTy-Pro / 0_reuse_code.js
Last active August 29, 2015 14:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
REM placer ce fichier à l'emplacement suivant
REM Windows 8
REM C:\Users\nom d’utilisateur\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
REM Windows 7/vista
REM C:\Utilisateurs\nom d’utilisateur\AppData\Roaming\Microsoft\Windows\Menu Démarrer\Programmes\Démarrage
ECHO | DEL /F /S /Q /A C:\Windows\TEMP\*.*
ECHO | DEL /F /S /Q /A "C:\Users\%username%\Appdata\Local\Temp\*-*"
@StephaneTy-Pro
StephaneTy-Pro / fill_form.js
Last active August 29, 2015 14:22
A form filler (for testing purpose)
(function( window ) {
var document = window.document,
fieldValueMap = {
'addressName' : 'Mon Adresse'
//, 'owner_counrty' : 'France'
, 'city' : 'Lille'
, 'postalCode' : '59000'
, 'addressLine4' : 'Bâtiment ou étage'
, 'owner_further_address_details' : 'Compl. Adresse' // id
//, 'owner_further_moving_date_month' : '01'
@StephaneTy-Pro
StephaneTy-Pro / fireEvent
Created June 2, 2015 12:33
Javasript FireEvent
// from http://www.cristinawithout.com/content/function-trigger-events-javascript
//It takes 2 parameters:
//obj - the object to trigger the event on
// evt - the name of the event to trigger (as a string)
function fireEvent(obj, evt){
var fireOnThis = obj;
if( document.createEvent ) {
var evObj = document.createEvent('MouseEvents');
@StephaneTy-Pro
StephaneTy-Pro / gist:ce786418ba5ac37c82cb
Last active March 29, 2016 12:01
commandes dos utiles
eventvwr REM windows event viewer
tasklist /fi "imagename eq cntlm.exe" REM parmi les tâches trouver la tach cntlm.exe
netstat -a-n-o | find "3128" REM trouver tout ce qui ecoute sur le port 3128
REM les deux commandes ci dessous sont executée en boite DOS d'ou le non doublement du % devant P (%%P dans un .bat)
REM trouver tous les processus qui ecoute sur le port 80 et renvoyer leur nom dans le gestionnaire des tâches
FOR /F "tokens=5 delims= " %P IN ('netstat -a -n -o ^| findstr :80') DO tasklist /fi "pid eq %P"
REM Mettre TaskKill.exe /PID %P permettrait de tuer la tâche
REM to get the PID plus a list of all services hosted by the process of PID 4
tasklist /svc /fi "PID eq 4" /fo list
@StephaneTy-Pro
StephaneTy-Pro / boxstarter-robotf-script
Created July 13, 2015 13:21
boxstarter robotframework
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -EnableShowAppsViewOnStartScreen -EnableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
Install-WindowsUpdate -acceptEula
cinst Python
Install-WindowsUpdate -acceptEula
@StephaneTy-Pro
StephaneTy-Pro / excel-convert_column_number_to_letter.txt
Created August 21, 2015 09:57
Excel : Convert Column Number to Letter
http://www.mrexcel.com/forum/excel-questions/71978-convert-column-number-letter.html
SUBSTITUE(ADRESSE(1;COLONNE();4);"1";"")
@StephaneTy-Pro
StephaneTy-Pro / SQL:Trouver doublons
Last active January 4, 2016 14:52
SQL doublons
http://sql.sh/55-requete-trouver-doublon
Doublons absolus
SELECT COUNT(*) AS nbr_doublon, champ1, champ2, champ3
FROM table
GROUP BY champ1, champ2, champ3
HAVING COUNT(*) > 1
Doublons sur colonne email par exemple
SELECT COUNT(email) AS nbr_doublon, email
// by using KingPin
sSep = app.Flag("separator", "Separator to use in csv file (in read and write) [default is ','].").Short('s').Default(",").String()
// Need to cast *sSep in rune for option Comma in "encoding/csv"
w.Comma = bytes.Runes([]byte(*sSep))[0] // fr => converti la chaine en tableau de bytes, pour apres la convertir en rune
@StephaneTy-Pro
StephaneTy-Pro / is_SubstringContainedInString.cmd
Last active December 6, 2022 08:40
CMD: Check if a substring is in a string
:: cherche si la chaine compiled est présente dans le nom de fichier
ECHO "truc-compiled" | findstr /r /c:"compiled" > nul && SET ISFOUND=1 || SET ISFOUND=0
:: Orgigin
:: http://stackoverflow.com/questions/8756804/check-a-string-for-a-substring-in-a-batch-file-windows
:: Author dbenham
:: This regular expression example will search $1 for "BEGIN" at start of string,
:: "MID" anywhere in middle, and "END" at end. The search is case sensitive by default.
set "search=^BEGIN.*MID.*END$"