Skip to content

Instantly share code, notes, and snippets.

View dpfg's full-sized avatar

dpfg dpfg

  • Poland
View GitHub Profile
@dpfg
dpfg / gist:3633008
Created September 5, 2012 08:05
SQL Ex 30
/**
* Exercise 30(3)
* Correct!
*/
SELECT fso.point,
fso.date,
fso.sum,
fsi.sum
FROM
(SELECT fp.point,
@dpfg
dpfg / gist:4234053
Created December 7, 2012 15:43
MongoDB simple shards
#!/bin/bash
echo "Make data dirs...."
mkdir ~/data
mkdir ~/data/config
mkdir ~/data/db
mkdir ~/data/shard0
mkdir ~/data/shard0/rs0
mkdir ~/data/shard0/rs1
mkdir ~/data/shard0/rs2
require "net/http"
uri = URI("http://services.mobile.de/1.0.0/ad/search?exteriorColor=BLACK&exteriorColor=RED&modificationTime.min=2008-05-04T18:13:51.0Z&firstRegistrationDate.min=2008-05")
request = Net::HTTP::Get.new(uri.request_uri)
request.basic_auth '', ''
request["Host"] = "services.mobile.de"
request["Accept"] = "application/xml"
@dpfg
dpfg / sublimeconfig.json
Created February 19, 2013 14:17
SublimeText user config
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Dayle Rees Color Schemes/LastNight.tmTheme",
"fade_fold_buttons": false,
"font_face": "Consolas",
"font_options":
[
"standardantialias"
],
@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
*
@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: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
<html>
<head>
<script src="https://cdn.jsdelivr.net/vue/latest/vue.js"></script>
</head>
<body>
<div id="app">
<h2>{{ name }}</h2>
<tabs>
@dpfg
dpfg / bumpme
Created November 1, 2018 19:52
e