Skip to content

Instantly share code, notes, and snippets.

View 4F2E4A2E's full-sized avatar

4F2E4A2E 4F2E4A2E

View GitHub Profile
const {GraphQLServer} = require('graphql-yoga');
const swaggerGraphQLSchema = require('swagger-to-graphql');
const API_BASE_URL = 'http://petstore.swagger.io/v2';
swaggerGraphQLSchema('./schema/petstore.swagger.json')
.then(schema => {
const options = {
port: 4000
};
const server = new GraphQLServer({
@4F2E4A2E
4F2E4A2E / base64.encoding.sh
Last active December 26, 2017 19:07
base64 encoding using bash
echo -n 'myuser:mypassword' | openssl base64
@4F2E4A2E
4F2E4A2E / remove-empty-files-and-images.bat
Created December 26, 2017 18:52
Remove empty files and images from current folder.
@echo off
FOR %%F IN (*.*) DO (
IF %%~zF LSS 1 DEL %%~nf.png
IF %%~zF LSS 1 DEL %%F
)
@4F2E4A2E
4F2E4A2E / meldmerge.git.config
Last active October 12, 2017 08:59
Meldmerge git configuration: http://meldmerge.org
Edit:
vim ~/.gitconfig
---
[diff]
tool = meld
[difftool]
prompt = false
[difftool "meld"]
cmd = meld "$LOCAL" "$REMOTE"
[alias]
@4F2E4A2E
4F2E4A2E / meteor-facepi-gist.js
Last active September 7, 2016 18:28
Faceapi Meteor.wrapAsync
/**
* Created by 4F2E4A2E & Daniel P. on 27.08.2016.
*/
var oxford = require('project-oxford'),
fs = require('fs');
/**
* TODO: Require the faceapi's id in order to start the app &/ give the possibility to add one via the ui.
* @type {oxford.Client}
*/
@4F2E4A2E
4F2E4A2E / SpringShellCustomPrompt.java
Created December 21, 2015 12:22
Spring Shell Custom Prompt Provider
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;
import org.springframework.shell.plugin.support.DefaultPromptProvider;
import org.springframework.stereotype.Component;
/**
* Class to set the CLI Prompt.
*/
@Component
@Order(Ordered.HIGHEST_PRECEDENCE)