Skip to content

Instantly share code, notes, and snippets.

View harf18's full-sized avatar

Geoffroy VIBRAC harf18

View GitHub Profile
@harf18
harf18 / test
Last active January 16, 2019 20:39
// just place a div at top right
var div = document.createElement('div');
div.style.position = 'fixed';
div.style.top = 0;
div.style.right = 0;
div.textContent = 'Injected!';
document.body.appendChild(div);
alert('inserted self... giggity');
@harf18
harf18 / Jenkinsfile
Created July 9, 2017 08:46 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, input steps, injected credentials, heroku deploy, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage concurrency constraints, ...
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
node {
// pull request or feature branch
if (env.BRANCH_NAME != 'master') {
checkout()
build()
unitTest()
@harf18
harf18 / myAJResource.js
Created November 5, 2015 13:41 — forked from djavier/myAJResource.js
Extends AngularJS $save method to use Put and Post for Updates and Creates respectively.
var module = angular.module( 'my.resource', [ 'ngResource' ] );
module.factory( 'Resource', [ '$resource', function( $resource ) {
return function( url, params, methods ) {
var defaults = {
update: { method: 'put', isArray: false },
create: { method: 'post' }
};
methods = angular.extend( defaults, methods );