Skip to content

Instantly share code, notes, and snippets.

View Ratings.java
package com.example.stream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
@aNNiMON
aNNiMON / EnexToJson.java
Created Aug 16, 2016
Converts Evernote .enex files to json
View EnexToJson.java
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.util.EnumSet;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import org.json.JSONArray;
@aNNiMON
aNNiMON / query.sql
Last active Jul 6, 2016
GitHub BigQuery: Top Java class/interface/enum names
View query.sql
SELECT classname, COUNT(*) c
FROM (
SELECT REGEXP_EXTRACT(content, r'class ([A-Z_$][A-Za-z\d_$]*)') as classname
FROM [fh-bigquery:github_extracts.contents_java]
HAVING classname IS NOT NULL
)
GROUP BY 1
ORDER BY 2 DESC
LIMIT 500
@aNNiMON
aNNiMON / vk_audiolinks_new.js
Created Apr 1, 2016
Сохраняет ссылки на вк аудио в текстовый файл
View vk_audiolinks_new.js
@aNNiMON
aNNiMON / exua-links.js
Last active Jan 27, 2016
ex.ua video links extractor
View exua-links.js
@aNNiMON
aNNiMON / listvkaudios.js
Last active Dec 2, 2015
List vk audios on page
View listvkaudios.js
function saveFile(filename, data) {
var blob = new Blob([data], {type:'text/plain'});
var saveLink = document.createElement("a");
saveLink.download = filename;
saveLink.innerHTML = "Save file";
if (window.webkitURL != null) {
saveLink.href = window.webkitURL.createObjectURL(blob);
} else {
saveLink.href = window.URL.createObjectURL(blob);
saveLink.onclick = destroyClickedElement;
View Template.class.php
<?php
/**
* Simple template engine
*/
class Template {
private static $templatesPath = 'templates/';
private static $cache = array();
@aNNiMON
aNNiMON / 1_EasyRss.md
Last active Apr 12, 2017
Small library to create rss feed
View 1_EasyRss.md

Usage

require_once './EasyRss.class.php';

$rss = EasyRss::create()->
    title('GitHub')->
    link('http://github.com/')->
    description('GitHub is the best place to build software together. Over 4 million people use GitHub to share code.')->
    pubDateByTimestamp(time())->
    category('IT')->
@aNNiMON
aNNiMON / asyncRequest.js
Last active Apr 23, 2017 — forked from pabloosso/asyncRequest.js
AJAX with memoization
View asyncRequest.js
//
// Author: Dustin Diaz
// http://dustindiaz.com/faster-ajax/
//
var asyncRequest = function() {
function handleReadyState(o, callback, fallback) {
if (!o || o.readyState != 4) return;
if (o.status == 200) {
if (callback) {
callback(o);
View designer.html
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../topeka-elements/avatars.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../code-mirror/code-mirror.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">