Skip to content

Instantly share code, notes, and snippets.

View dpfg's full-sized avatar

dpfg dpfg

  • Poland
View GitHub Profile
@dpfg
dpfg / script-frame.html
Created June 2, 2025 07:22
Scripting frame
<script>
console.log(009099990392434234234234)
</script>
<h2>Scripting is here</h2>
@dpfg
dpfg / main.go
Created October 20, 2021 14:35
Shared Building return calculation
package main
import (
"fmt"
"time"
)
type Ref struct {
AsOfDate time.Time
Value float64
@dpfg
dpfg / scrpit.groovy
Created December 14, 2020 07:15
Reset Jenkins job
// go to http://jenkins/script
item = Jenkins.instance.getItemByFullName("path/to/job")
item.builds.each() { build ->
build.delete()
}
item.updateNextBuildNumber(1)
@dpfg
dpfg / Main.java
Last active August 3, 2019 08:07
Boxing cache test
public class Main {
public static void main(String[] args) {
// According to JLS https://docs.oracle.com/javase/specs/jls/se7/html/jls-5.html
// If the value p being boxed is true, false, a byte, or a char in the range \u0000 to \u007f, or an int or short number between -128 and 127 (inclusive), then let r1 and r2 be the results of any two boxing conversions of p. It is always the case that r1 == r2.
// So only for certain cases reference caching is mandatory.
// Caching for double is not mandatory. See small text - it would be ideal to have but it's not a part of the spec.
// In actuall implementation (open jdk 12) there is no cache for doubles
Double d1 = Double.valueOf("90");
Double d2 = Double.valueOf("90");
@dpfg
dpfg / bumpme
Created November 1, 2018 19:52
e
<html>
<head>
<script src="https://cdn.jsdelivr.net/vue/latest/vue.js"></script>
</head>
<body>
<div id="app">
<h2>{{ name }}</h2>
<tabs>
@dpfg
dpfg / gist:51ae61b51906f93bb1e20792b1fb08ba
Created June 16, 2016 04:48
Distributed storage systems and programming models [Reading]
Date Subject Readings
1/5 Welcome
1/7 Fundamentals: doom and gloom
1/12 Fundamentals: rays of hope Detecting Causal Relationships in Distributed Computations: In Search of the Holy Grail
1/14 Fundamentals: rays of hope The Weakest Failure Detector for Solving Consensus
1/19 Fundamentals: what we know
1/21 Storage: naming and finding [Chord: A Scalable Peer-to-peer Lookup Service for InternetApplications](https://pdos.c
@dpfg
dpfg / gist:8342039
Created January 9, 2014 21:07
T-SQL syntax for sublime
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>uuid</key>
<string>6052353D-4EDA-4263-9535-4293100AA58A</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
@dpfg
dpfg / gist:6028287
Last active December 19, 2015 22:38
Work with arrays performance. http://www.youtube.com/watch?v=Q-7y1u9kZV0 Роман Елизаров — Миллионы котировок в секунду на чистой Java
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
/**
* Test performance of link list, array list, Object[] and flatted to int[] object(FieldHolder)
* @author Aliaksandr_Chaiko
*