Skip to content

Instantly share code, notes, and snippets.

@dmtrs
dmtrs / nodejs-notes.md
Created August 8, 2020 11:29
nodejs notes
#!/bin/sh
sudo apt install libopenblas-base libopenmpi-dev gfortran libopenblas-dev liblapack-dev htop libfreetype6 libfreetype6-dev llvm-8 llvm-8-dev llvm-8-runtime sox
@dmtrs
dmtrs / mergeSort.scd
Created May 12, 2018 09:21
Supercollider merge sort
(
var mergeSort = { |arr|
var merge = {|head, tail|
var i = 0;
var j = 0;
var k = head.size + tail.size;
head = head.add(0xfffffff);
tail = tail.add(0xffffff);
k.collect({
@dmtrs
dmtrs / test_avocarrot_authentication.sh
Created January 31, 2017 13:50
Avocarrot new authentication service test
#!/bin/bash
# Requirements:
# - curl
# - jq
CLIENT_ID=your-client-id
CLIENT_SECRET=your-client-secret
USERNAME=publisher-username
PASSWORD=publisher-password
@dmtrs
dmtrs / request.sh
Created April 20, 2016 12:03
Avocarrot Reporting API examples
#!/bin/bash
curl -L -s \
-H 'Accept: application/json; charset=utf-8' \
https://reporting.avocarrot.com/v1/publishers/7214\?access_token\=asdfgdf92bfd67b15195\&granularity\=day
$ curl https://reporting.avocarrot.com/v1/publishers/7214\?access_token\=a065df92bfd67b15195cd0901a30a0a7949c0de2\&granularity\=day
{
"query": {
"filters": {
"publisher_id": [ "7214" ],
"app_id": [],
"placement_key": [],
"country": []
},
"granularity": "day",
@dmtrs
dmtrs / kafka 0.9.0.0 MBeans
Created December 16, 2015 16:13
kafka 0.9.0.0 MBeans
JMImplementation:type=MBeanServerDelegate
com.sun.management:type=HotSpotDiagnostic
java.lang:name=Code Cache,type=MemoryPool
java.lang:name=CodeCacheManager,type=MemoryManager
java.lang:name=G1 Eden Space,type=MemoryPool
java.lang:name=G1 Old Gen,type=MemoryPool
java.lang:name=G1 Old Generation,type=GarbageCollector
java.lang:name=G1 Perm Gen,type=MemoryPool
java.lang:name=G1 Survivor Space,type=MemoryPool
java.lang:name=G1 Young Generation,type=GarbageCollector
"use strict";
var __moduleName = "annotations";
var isFunction = $traceurRuntime.assertObject(require('./util')).isFunction;
var SuperConstructor = function SuperConstructor() {};
($traceurRuntime.createClass)(SuperConstructor, {}, {});
var TransientScope = function TransientScope() {};
($traceurRuntime.createClass)(TransientScope, {}, {});
var Inject = function Inject() {
for (var tokens = [],
$__5 = 0; $__5 < arguments.length; $__5++)
@dmtrs
dmtrs / gist:4984301
Last active December 13, 2015 22:28
Random Tumblr photo on my desktop background (Gnome)
#!/usr/bin/php
<?php
$config = array(
'api_key' => 'get your api key from http://www.tumblr.com/oauth/apps',
'sleep' => 45,
'debug' => true,
'blogs' => array(
'whiteshoe',
'devopsreactions',
'afr0diti',
@dmtrs
dmtrs / gist:4955105
Last active December 13, 2015 18:28
<?php
/**
*
**/
require_once __DIR__.'/../ograph/Graph.php';
require_once __DIR__.'/../ograph/Node.php';
class GraphTest extends PHPUnit_Framework_TestCase
{
public function testNodeCreation()