Skip to content

Instantly share code, notes, and snippets.

View milovtim's full-sized avatar

Timur milovtim

  • MTVv
  • Saint-Petersburg
View GitHub Profile
@milovtim
milovtim / WsChat.html
Last active August 29, 2015 14:10 — forked from chitan/WsChat.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tomcat WebSocket Chat</title>
<script>
var ws = new WebSocket("ws://localhost:8080/WsChat/wschat");
ws.onopen = function(){
};
ws.onmessage = function(message){
@milovtim
milovtim / gist:7f5a48f30cdf6a6d87e71e793fb2d589
Created December 8, 2016 14:49 — forked from aaronshaf/bookmarklet-expanded.js
Copy text from Amazon's Cloud Reader
// Useful for students in need of block quotes for their paper, etc.
// Execute the line in your JavaScript console
new_window=window.open();new_window.document.body.innerHTML = $('iframe').contents().find('iframe').contents().find('body').get(1).innerHTML;
javascript:new_window=window.open();new_window.document.body.innerHTML = $('iframe').contents().find('iframe').contents().find('body').get(1).innerHTML;
@milovtim
milovtim / table.filter.lua
Created March 16, 2018 11:43 — forked from FGRibreau/table.filter.lua
Lua table.filter (JavaScript Array::filter equivalent)
-- table.filter({"a", "b", "c", "d"}, function(o, k, i) return o >= "c" end) --> {"c","d"}
--
-- @FGRibreau - Francois-Guillaume Ribreau
-- @Redsmin - A full-feature client for Redis http://redsmin.com
table.filter = function(t, filterIter)
local out = {}
for k, v in pairs(t) do
if filterIter(v, k, t) then out[k] = v end
end
@milovtim
milovtim / app.java
Created May 20, 2021 11:55 — forked from mobleyc/app.java
Loading resource bundles in Java from property files outside of classpath, with different file extensions.
package com.cpm;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.Locale;
import java.util.PropertyResourceBundle;
@milovtim
milovtim / Employee.java
Created February 14, 2024 09:15 — forked from mefernandez/Employee.java
Spring Data's Page and @JSONVIEW solution
@Entity
public class Employee {
@Id
@GeneratedValue
private Long id;
@JsonView(SummaryView.class)
private String name;