Skip to content

Instantly share code, notes, and snippets.

View dimkir's full-sized avatar
🎯
Focusing

dimkir

🎯
Focusing
View GitHub Profile
@dimkir
dimkir / CategoryRepository.php
Created February 3, 2016 17:26
Attempt to limit quantity of loaded relationships (eg. only load 5 presentations with the Category)
<?php
namespace AppBundle\Repository;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\Tools\Pagination\Paginator;
class CategoryRepository extends EntityRepository
@dimkir
dimkir / UpdateCommand.php
Created January 12, 2016 17:53
Modified to format and syntax highlight sql statements
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@dimkir
dimkir / .screenrc
Created September 7, 2015 16:00
Minimal .screenrc for gnu-screen with status line
hardstatus alwayslastline "%H %-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
@dimkir
dimkir / gist:8551171
Created January 22, 2014 00:15
This is full output of running Spring-boot-actuator when it fails this AuthenticationManagerBuilder
ubuntu@ubuntu-VirtualBox:~/spring-boot-actuator-attempt$ java -jar target/myproject-1.0.0-SNAPSHOT.jar
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v0.5.0.M7)
@dimkir
dimkir / sketch_code.pde
Created November 22, 2013 13:42
Created using Sketch2Tweet tool
void setup() {
size(400, 400);
colorMode(HSB, 255);
background(0, 0, 0);
noStroke();
}
void draw() {
float r=random(10, 100);
fill(color(r, 255,255));
rect(r,r, r, r);
@dimkir
dimkir / MySaveBytes.pde
Created November 22, 2013 13:30
Processing sketch : saveBytesGZFailure
public void saveBytesZZZ(String filename, byte[] data) {
saveBytesZZZ(saveFile(filename), data);
}
/**
* @nowebref
* Saves bytes to a specific File location specified by the user.
@dimkir
dimkir / main.pde
Created November 13, 2013 13:55
Processing sketch : stackIterator
Stack<String> stack;
void draw(){
background(0);
text(stack.pop(), width/2, height/2 );
stack.push(mouseX + ", " + mouseY);
}
@dimkir
dimkir / sketch_code.pde
Created November 13, 2013 13:05
Created using Sketch2Tweet tool
Liquid liquid;
Surface srf;
int C_BALL_COUNT = 10;
int C_LIQUID_WIDTH = 300;
int C_LIQUID_HEIGHT = 50;
Ball[] balls = new Ball[C_BALL_COUNT];
PVector forceDownward = new PVector(0.0, 0.03); // just going down
@dimkir
dimkir / sketch_code.pde
Created November 13, 2013 13:02
Created using Sketch2Tweet tool
//import org.twitshot.*;
Mover mm;
Attractor aa;
void setup(){
size(1024, 768);
//Twitshot.spawn(this);
@dimkir
dimkir / sketch_code.pde
Created November 13, 2013 12:50
Created using Sketch2Tweet tool
// new script
/**
* This variable PGraphics will hold the
* framebuffer into which you're only
* going to ddraw rectangles.
*/
PGraphics frameBuffer;
void setup(){
size(800,600);