Skip to content

Instantly share code, notes, and snippets.

View amcsi's full-sized avatar
🏠
Working from home

Attila Szeremi amcsi

🏠
Working from home
View GitHub Profile
@amcsi
amcsi / elm-package.json
Created May 10, 2016 19:59
failing elm-package.json
{
"version": "1.0.0",
"summary": "Tic Tac Toe practice project",
"repository": "https://github.com/amcsi/elm-tic-tac-toe.git",
"license": "MIT",
"source-directories": [
"."
],
"exposed-modules": [],
"dependencies": {
@amcsi
amcsi / memleak.php
Created July 10, 2016 17:22
PHP memory leak
<?php
function printMemoryUsage() {
gc_collect_cycles();
printf("Memory used: %.4fMB\n", memory_get_usage() / 1024 / 1024);
}
gc_enable();
$batchCount = 1000;
$iterations = 10000;
@amcsi
amcsi / createElement.vue
Created April 17, 2017 16:17
Vue file showing createElement() method references not working in IntelliJ plugin
<template>
<div>
<button type="button" @click="createElement()">Create element</button>
<button type="button" @click="prependRow()">+</button>
</div>
</template>
<script>
export default {
methods: {
<?php
declare(strict_types=1);
/**
* Walks nested array structures to retrieve values.
*/
class ArrayWalkerReference
{
/**
<?php
declare(strict_types=1);
/**
* Walks nested array structures to retrieve values.
*/
class ArrayWalkerValue
{
/**
#!/usr/bin/env bash
# Break on error.
set -e
cd "$(dirname "$0")"/..
composer install
bin/api odm:generate:proxies
@amcsi
amcsi / output.txt
Created October 15, 2017 15:29
Can't stop or kill the container
root@www:~/szeremi-nginx (master)# docker stop --time=1 phpunit-failures
phpunit-failures
root@www:~/szeremi-nginx (master)# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e277c2c43887 3c57f4edf595 "npm run start" 22 minutes ago Up 22 minutes 1337/tcp phpunit-failures
@amcsi
amcsi / myanimelist-alternatives.md
Last active February 27, 2018 04:00 — forked from cheeaun/myanimelist-alternatives.md
MyAnimeList.net alternatives
@amcsi
amcsi / logs
Last active March 28, 2018 21:16
Systemd result of removing Restart=Always
root@www:~/szeremi-nginx (master *)# systemctl status szeremi-nginx
● szeremi-nginx.service - Autoconfigured Nginx-Reverse-Proxy
Loaded: loaded (/root/szeremi-nginx/units/szeremi-nginx.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Wed 2018-03-28 21:14:02 UTC; 1min 7s ago
Process: 28666 ExecStop=/usr/bin/docker stop %p (code=exited, status=0/SUCCESS)
Process: 28473 ExecStart=/usr/bin/docker start %p (code=exited, status=0/SUCCESS)
Process: 28465 ExecStartPre=/usr/bin/docker network connect szeremi %p (code=exited, status=0/SUCCESS)
Process: 28453 ExecStartPre=/usr/bin/docker create --rm --name %p -p 80:80 -p 443:443 -v /certs:/etc/nginx/certs:ro -v /etc/nginx/vhost.d -v /usr/share/nginx/html -v /var/run/docker.sock:/tmp/docker.sock ${CONTA
Process: 28445 ExecStartPre=/usr/bin/docker rm %p (code=exited, status=1/FAILURE)
Process: 28437 ExecStartPre=/usr/bin/docker kill %p (code=exited, status=1/FAILURE)
extern crate rayon;
use rayon::prelude::*;
use std::str;
use std::ops::Range;
use rayon::range::Iter;
fn main() {
crack("zzzzz");
}