Skip to content

Instantly share code, notes, and snippets.

View 255kb's full-sized avatar
👨‍💻

Guillaume 255kb

👨‍💻
View GitHub Profile
@255kb
255kb / export.json
Created September 24, 2020 19:01
Web Zürich Mockoon mock API demo
{
"source": "mockoon:1.10.0",
"data": [
{
"type": "environment",
"item": {
"uuid": "",
"lastMigration": 12,
"name": "Web Zürich demo",
"endpointPrefix": "",
@255kb
255kb / bookmarklet.js
Last active March 2, 2018 21:37
send current page link as github issue bookmarklet
javascript:
var access_token = "TOKEN";
var owner = "OWNER";
var repo = "REPO";
var currentUrl = location.href;
var currentTitle = document.title;
var createIssue = 'https://api.github.com/repos/' + owner + '/' + repo + '/issues?access_token=' + access_token;
var xhr = new XMLHttpRequest;
@255kb
255kb / vscode.bat
Last active May 18, 2018 11:54
To Launch Cmder from VSCode or Hyper, put vscode.bat in c:/tools/cmder, and add following config to VSCode
@echo off
SET CurrentWorkingDirectory=%CD%
SET CMDER_ROOT=C:\tools\cmder
CALL "%CMDER_ROOT%\vendor\init.bat"
CD /D %CurrentWorkingDirectory%
@255kb
255kb / reporter.js
Created April 4, 2017 12:33
Mocha custom reporter
var mocha = require('mocha');
module.exports = MyReporter;
function MyReporter(runner) {
mocha.reporters.Base.call(this, runner);
var passes = 0;
var failures = 0;
runner.on('pass', function(test){
passes++;
@255kb
255kb / lambda.py
Last active April 27, 2021 00:50
AWS Lambda function to update a security group with Elastic Beanstalk instances IPs
'''
Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/
or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
'''
import boto3
import hashlib
import json
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@255kb
255kb / md-colors.css
Created February 18, 2015 14:45
Material Design colors for texts and backgrounds
/* Material Design colors for texts and backgrounds */
.md-text-red{
color: #f44336;
}
.md-text-red-50{
color: #ffebee;
}
.md-text-red-100{
color: #ffcdd2;
}
@255kb
255kb / library_singObject_jQuery.js
Created February 13, 2015 15:44
Javascript library pattern (single object) with jQuery dependency
/* Replace 'library' by your library name */
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
//AMD
define(['jquery'], function($) {
return factory($);
});
} else if (typeof module !== 'undefined' && module.exports) {
//Node.js or CommonJS
@255kb
255kb / library_instObject_jQuery.js
Created February 13, 2015 15:44
Javascript library pattern (instantiable object) with jQuery dependency
/* Replace 'library' by your library name */
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
//AMD
define(['jquery'], function($) {
return factory($);
});
} else if (typeof module !== 'undefined' && module.exports) {
//Node.js or CommonJS
@255kb
255kb / library_instObject.js
Last active August 29, 2015 14:15
Javascript library pattern (instantiable object)
/* Replace 'library' by your library name */
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
//AMD
define([], factory);
} else if (typeof module !== 'undefined' && module.exports) {
//Node.js or CommonJS
module.exports = factory();
} else {