Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View finnjohnsen's full-sized avatar

Finn Johnsen finnjohnsen

  • Kodemaker
  • Oslo, Norway
  • 18:52 (UTC +02:00)
View GitHub Profile
Process: Blender [9857]
Path: /Applications/Blender.app/Contents/MacOS/Blender
Identifier: org.blenderfoundation.blender
Version: 2.93.0 (2.93.0 2021-04-12)
Code Type: ARM-64 (Native)
Parent Process: ??? [1]
Responsible: Blender [9857]
User ID: 501
Date/Time: 2021-04-13 20:37:34.581 +0200
@finnjohnsen
finnjohnsen / GreasePencilCheatSheet.md
Last active February 20, 2021 02:15
Blender Grease Pencil - Cheat Sheet

Most important

Shortcut Operation
s-space pen toolbar menu
hold shift while drawing, straigh line assist
w pen context menu
n properties panel
u active material drop down
@finnjohnsen
finnjohnsen / gist:01e6194f61acc9da8743b24163d0be96
Last active December 12, 2018 12:36
test cron expression
@Test
public void testCronExpression() throws Exception {
CronExpression ce = new CronExpression("0 0 0 * * ?");
Date next = new Date();
for (int count = 0; count <= 20; count++) {
next = ce.getNextValidTimeAfter(next);
System.out.println(next);
}
assert true;
}
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<scope>test</scope>
</dependency>
import ch.qos.logback.classic.boolex.GEventEvaluator
import ch.qos.logback.classic.encoder.PatternLayoutEncoder
import ch.qos.logback.core.ConsoleAppender
import ch.qos.logback.core.filter.EvaluatorFilter
import static ch.qos.logback.classic.Level.DEBUG
import static ch.qos.logback.core.spi.FilterReply.DENY
import static ch.qos.logback.core.spi.FilterReply.NEUTRAL
appender("CONSOLE", ConsoleAppender) {
encoder(PatternLayoutEncoder) {
https://docs.google.com/presentation/d/1TtAwelPlRRJtZa0wci2BIf39wYE5_aGSVlxXAOWM0R0/edit?usp=sharing
https://youtu.be/KRh3aapICZc?t=120
Saving world data: 2%
Saving world data: 7%
Saving world data: 12%
Saving world data: 17%
Saving world data: 22%
Saving world data: 27%
Saving world data: 31%
Saving world data: 37%
Saving world data: 42%
Saving world data: 47%
@finnjohnsen
finnjohnsen / console.groovy
Created November 21, 2013 14:16
demonstrates fetching TTL values from EhCache using Grails Console Plugin
import grails.plugin.cache.ehcache.GrailsEhcacheCache;
import net.sf.ehcache.Ehcache;
import net.sf.ehcache.Element;
import org.joda.time.*
GrailsEhcacheCache gC = ctx.grailsCacheManager.getCache('customerAdvisors')
Ehcache nC = gC.getNativeCache()
Element e = nC.get(0) //0 is the key if the method has no parameters.
println new DateTime(new Date(e.getExpirationTime()))
println new DateTime(new Date(e.getCreationTime()))
@finnjohnsen
finnjohnsen / exposeEHCache.groovy
Created November 21, 2013 13:34
Put this in Bootstrap.groovy and Ehcache will be exposed in JMX.
net.sf.ehcache.management.ManagementService.registerMBeans(
grailsApplication.mainContext.getBeansOfType(net.sf.ehcache.CacheManager).values().first(),
grailsApplication.mainContext.getBeansOfType(javax.management.MBeanServer).values().first(),
true, true, true, true)
@finnjohnsen
finnjohnsen / MyService.groovy
Last active December 16, 2015 07:38
Timer spawning service
import java.util.*
// very silly example spawning a thread
class MyService {
TimerTask task
Timer timer
def startJobs() {
timer = new Timer("Job") //Setting job name is important for the test
task = timer.runAfter(10000, {})