Skip to content

Instantly share code, notes, and snippets.

Avatar

Wojciech Frącz fracz

  • Poland
View GitHub Profile
@fracz
fracz / README.md
Last active Jun 11, 2016
ReveritbleAction for Angular implementation (allows to undo an operation before the request is sent to the backend).
View README.md

Angular Revertible Action

Example use:

angular.module('xxx').controller 'TreasureController', ($scope, treasureId, RevertibleAction, Restangular) ->

  Restangular.one('treasure', treasureId).get().then (treasure) ->
    $scope.treasure = treasure
View README.md
<div loading-cover="coversIfThisIsTrue">
   CONTENT
</div>
@fracz
fracz / memoize-expirable-decorator.spec.ts
Created Jan 14, 2017
Typescript memoize decorator with expiration time
View memoize-expirable-decorator.spec.ts
import {memoize, clearMemoizedValue} from "./memoize";
describe("memoize", () => {
class MyClass {
@memoize(5)
getNumber() {
return Math.random();
}
}
@fracz
fracz / README.md
Last active Mar 2, 2017
Aurelia Promise Button
View README.md

Aurelia Promise Button

A button that disables itself until the promise is resolved. See the provided animations below.

Default values work with Bootstrap and Font Awesome, but you can adjust it to your needs.

How to use?

Your template:

@fracz
fracz / README.md
Created Mar 9, 2017
FFMPEG time lapse from photos
View README.md
ffmpeg -r 15 -start_number 1 -i frame%04d.JPG -s 1280x720 -vcodec libx264 timelapse.mp4
@fracz
fracz / aw.xml
Last active Mar 24, 2017
Coffeescript Angular templates for IntelliJ IDEA
View aw.xml
<template name="aw" value="@org.springframework.beans.factory.annotation.Autowired&#10;private $CLASS_NAME$ $FIELD_NAME$;" description="Adds @Autowired field" toReformat="true" toShortenFQNames="true">
<variable name="CLASS_NAME" expression="" defaultValue="" alwaysStopAt="true" />
<variable name="FIELD_NAME" expression="" defaultValue="decapitalize(CLASS_NAME)" alwaysStopAt="true" />
<context>
<option name="JAVA_DECLARATION" value="true" />
</context>
</template>
@fracz
fracz / index.html
Last active Aug 11, 2017 — forked from darwin/index.html
Welcome to comix!
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css">
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script>
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style>
<body>
<div style="max-width:900px; -webkit-transform:rotate(0deg)">
<scene id="scene1">
<label t="translate(0,346)">
@fracz
fracz / backup.sh
Created Mar 3, 2018
Automatic dockerized SUPLA MySQL database backup to Google Drive
View backup.sh
#!/usr/bin/env bash
# Sample crontab: 0 */2 * * * /home/unicorn/backup.sh > /home/unicorn/backup.log 2>&1
NOW=$(date +"%Y%m%d%H%M%S")
BACKUP_FILE=supla-$NOW.sql
GDRIVE_DIR=0B0OnuB36CtoeknVRX2xRbS1sT1E
SUPLA_PATH=/var/www/supla-docker
BACKUP_EXPIRATION_DAYS=7
@fracz
fracz / app.html
Last active Mar 22, 2018 — forked from ScottWhittaker/app.html
Aurelia Router open in new tab bug - aurelia/router#457
View app.html
<template>
<require from="components/navigation.html"></require>
<h1>Aurelia Router Demo</h1>
<navigation router.bind="router" class="primary-navigation"></navigation>
<div class="page-host">
<router-view></router-view>
</div>
</template>
@fracz
fracz / Readme.md
Last active Nov 26, 2020
Restore intentionally deleted commits in Git
View Readme.md

Restore intentionally deleted commits in Git (remote)

Situation

  1. You own a Git repository server and the developers do not have access to it (i.e. they can only read & write to the repo, but not gc it).
  2. You had a developer that wrote a project for you.
  3. He got angry for whatever reason and deleted all branches from the remote repo. He also push -fed the master branch leaving only one silly commit there.
  4. He escaped from the country leaving you without any code at all (at least this is what he believe in).
  5. You have never cloned the repo to other machine. There were only two copies of it: the developer's one and the server's one.