Skip to content

Instantly share code, notes, and snippets.

View sommereder's full-sized avatar

Mario Sommereder sommereder

View GitHub Profile
@sommereder
sommereder / index.html
Created May 11, 2016 07:47
IPC Renderer Service for Electron/Angular2
<script>
const electron = require('electron');
// below is just plain angular stuff
System
.config({
packages: {
angular: {
format: 'register',
defaultExtension: 'js'
<?php
class Gimme {
static function aGridField($__name, $__label, $__storage, $__numItemsPerPage = 32) {
$_gridFieldConfig = Gimme::getGridFieldConfig($__numItemsPerPage);
return new GridField($__name, $__label, $__storage, $_gridFieldConfig);
}
public string RunTasksAndGetResponse(int pNumTasks = 0)
{
if (mRequestJson != null && mResponseJson != null) // check for necessary files
{
string lResponseString = "{\"ActionResult\":{\"Result\": \"ERROR: Timeout reached while executing eggPlant task(s).\",\"Expected\":[],\"Received\":[],\"Screenshots\":[]}}";
Stopwatch lRequestStopwatch = Stopwatch.StartNew();
TimeSpan lRequestTimeout = TimeSpan.FromSeconds((pNumTasks > 1 ? 5 : 10) * 60 * pNumTasks);
string lCampaignId = CreateCampaign(mRequestJson, mResponseJson); // create campaign by requesting the API
@sommereder
sommereder / my-modal.component.ts
Last active July 24, 2020 03:57
Get the outputs to/from the modal, by passing them as event emitter to the modal service and subscribe directly at the component opening the modal box.
import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({
selector: 'app-my-modal',
styleUrls: ['./my-modal.component.scss'],
template: `
<p>{{content}}</p>
<button (click)="confirm()">OK</button>
`,
})
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
@mixin position(
$position: static,
$top: auto,
$right: auto,
$bottom: auto,
$left: auto,
$z-index: auto,
) {
position: $position;
top: $top;
package com.acme.tree.config;
import java.util.Arrays;
import java.util.Collections;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
@sommereder
sommereder / move-repo.md
Created May 8, 2021 07:26
Move git repository from wherever to GitHub

Create a new repository on GitHub: https://github.com/new

Checkout the repository from the old provider using git clone --mirror, which implies -bare and thus does not generate a working copy:

git clone --mirror [email protected]:company/myrepo.git

Change into project directory:

cd myrepo.git