Skip to content

Instantly share code, notes, and snippets.

View OJezu's full-sized avatar

Christopher Chrapka OJezu

View GitHub Profile
(function(buster, define){
var assert;
assert = buster.assert;
define('monitor-output-test.js', function(require){
var when = require('when');
buster.testCase('when/monitor/console', {
'should output information about rejected promises with no onRejected': function(done){
var output = false;
@OJezu
OJezu / aligned-list.js
Created February 24, 2015 01:36
blessed-aligned-list
'use strict';
var sprintf = require('sprintf');
var uuid = require('node-uuid');
var Box = require('blessed').Box;
var List = require('blessed').List;
var Node = require('blessed').Node;
var Text = require('blessed').Text;
function AlignedList(options){
@OJezu
OJezu / gist:ac68284ff5191e9df365
Last active September 26, 2015 18:56
Clean up some php code in repository
#convert leading 4-spaces to tabs
for i in $(seq 15); do
find . -! -path "*/.git/*" -! -path "*/bower_components/*" -type f -! -path "./img/*" -! -path "./_log/*" -! -path "./download/*" -! -path "./fonts/*" -exec sed -i "s/^\(\( \)*\)\( \)/\1\t/" \{\} \;
done
#remove trailing whitespace
find . -! -path "*/.git/*" -! -path "*/bower_components/*" -type f -! -path "./img/*" -! -path "./_log/*" -! -path "./download/*" -! -path "./fonts/*" -exec \
sed -i "s/\(\t\| \)\+\$//" \{\} \;
#remove multiple empty lines
# delete remote merged branches
git branch -r --merged | grep origin | grep -v '>' | grep "^ origin/\(hotfix\|feature\|bugfix\)" | xargs -L1 | cut -d"/" -f 2- | xargs -r git push origin --delete
# delete local merged branches
git branch --merged | grep "^ \(hotfix\|feature\|bugfix\)" | xargs -L1 | xargs -r git branch -d
<?php
namespace OJezu\FormatResponseBundle\Annotation\Controller;
/**
* @Annotation
*/
class FormatResponse
{
rm: cannot remove '/home/krzysztofchrapka/.steam/steam': Is a directory
rm: cannot remove '/home/krzysztofchrapka/.steam/bin': Is a directory
Installing breakpad exception handler for appid(steam)/version(1504757234)
Installing breakpad exception handler for appid(steam)/version(1504757234)
Gtk-Message: Failed to load module "gail"
Gtk-Message: Failed to load module "atk-bridge"
(steam:4604): Gtk-WARNING **: Unable to locate theme engine in module_path: "adwaita",
/usr/share/themes/Adwaita/gtk-2.0/main.rc:733: error: unexpected identifier `direction', expected character `}'
$ steam
Running Steam on debian 9 64-bit
STEAM_RUNTIME is enabled automatically
Pins up-to-date!
[2017-09-08 20:27:01] Startup - updater built Sep 6 2017 20:37:15
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[2017-09-08 20:27:01] Checking for update on startup
[2017-09-08 20:27:01] Checking for available updates...
[2017-09-08 20:27:02] Download skipped: /client/steam_client_ubuntu12 version 1504757234, installed version 1504757234
[2017-09-08 20:27:02] Nothing to do
In Validate.php line 105:
[InvalidArgumentException]
'connectionString' can't be NULL or empty.
Exception trace:
MicrosoftAzure\Storage\Common\Internal\Validate::notNullOrEmpty() at /vendor/microsoft/azure-storage/src/Common/Internal/ConnectionStringParser.php:78
MicrosoftAzure\Storage\Common\Internal\ConnectionStringParser::parseConnectionString() at /vendor/microsoft/azure-storage/src/Common/Internal/ServiceSettings.php:86
MicrosoftAzure\Storage\Common\Internal\ServiceSettings::parseAndValidateKeys() at /vendor/microsoft/azure-storage/src/Common/Internal/StorageServiceSettings.php:365
@OJezu
OJezu / BUT_WAIT_THERE_IS_MORE.php
Last active October 25, 2018 10:21
PHP IS SOOO GREAT
function getPDO(): \PDO
{
return new \PDO("mysql:dbname=solidsnake_dev;host=db", "solidsnake_dev", "solidsnake_dev", [
PDO::ATTR_PERSISTENT => true,
]);
}
$pdo = getPDO();
$pdo->exec('CREATE TEMPORARY TABLE temp_test (id INT NOT NULL PRIMARY KEY)');
@OJezu
OJezu / main.ts
Created October 25, 2019 14:28
Nest.js logger not available by default
import {Injectable, Logger, Module} from '@nestjs/common';
import {NestFactory} from '@nestjs/core';
import {NestExpressApplication} from '@nestjs/platform-express';
@Injectable()
class TestService {
constructor(private readonly logger: Logger){
this.logger.log("UP");
}
}