Skip to content

Instantly share code, notes, and snippets.

View brakmic's full-sized avatar
🏠

Harris Brakmić brakmic

🏠
View GitHub Profile
//helper function for DOM manipulation
var updateDOM = function(res,res2,res3){
$('#res').html(JSON.stringify(res));
$('#res2').html(JSON.stringify(res2));
$('#res3').html(JSON.stringify(res3));
};
//Defines a generator to call a JSON webservice.
//info 1: for each "yield" a separate generator call is needed
//this is why generators are called "pausable functions"
# THIS CODE IS NOW RETIRED. GO TO THE NEW REPOSITORY: https://github.com/brakmic/TwitterClient
# -*- coding: utf-8 -*-
#==============================================================================
# A simple console-based twitter client capable of persisting data
# Usage: python client.py --config=your_json_config.json
# To persist to a database a valid DNS entry is needed.
# Also, create a proper Tweets table. Check 'insert' method in DbConnector.
# =============================================================================

Keybase proof

I hereby claim:

  • I am brakmic on github.
  • I am brakmic (https://keybase.io/brakmic) on keybase.
  • I have a public key whose fingerprint is F7CF 8C4A 79D8 9EBE 0808 74C3 F8B1 3389 9C9B 8056

To claim this, I am signing this object:

@brakmic
brakmic / git_workflow.md
Last active December 22, 2016 11:48
A simple git workflow demonstration under Windows

Preparation

  • Download Git from here: https://git-for-windows.github.io/

  • Click Next, Next, blah, blah...until you get a proper Git environment in your Windows box

  • Open Git Shell, or any other command prompt that has access to your Git path (if unsure, check System Environment Settings)

Initialize Repository

#include <thrill/api/cache.hpp>
#include <thrill/api/generate.hpp>
#include <thrill/api/print.hpp>
#include <ostream>
#include <random>
using thrill::DIA;
int main() {
// launch Thrill program: the lambda function will be run on each worker.
return thrill::Run(
[&](thrill::Context& ctx) { Process(ctx); });
}
void Process(thrill::Context& ctx) {
std::default_random_engine rng(std::random_device { } ());
std::uniform_real_distribution<double> dist(0.0, 1000.0);
// generate 100 random points using uniform distribution
DIA<Point> points =
Generate(
ctx, /* size */ 100,
[&](const size_t& /* index */) {
return Point { dist(rng), dist(rng) };
})
@brakmic
brakmic / main_script.ts
Created March 12, 2017 12:03
webvr - project - main script
export function main(): Promise<any> {
return platformBrowserDynamic()
.bootstrapModule(AppModule)
.then(decorateModuleRef)
.catch((err) => console.error(err));
}
const hello = <IVrModule>{
id: '001',
name: 'hello',
type: VrModuleType.AFrame,
markup: `
<a-scene>
<a-sphere position="0 1.25 -1" radius="1.25" color="#EF2D5E"></a-sphere>
<a-box position="-1 0.5 1" rotation="0 45 0" width="1" height="1" depth="1"
color="#4CC3D9"></a-box>
<a-cylinder position="1 0.75 1" radius="0.5" height="1.5" color="#FFC65D">
@brakmic
brakmic / vr-module-register.ts
Created March 12, 2017 12:32
registering vr modules and dispatching messages
public registerModule(): Observable<IServiceMessage> {
return this.asObservable().map((mod) => {
if (!_.isNil(mod) &&
!_.isNil(mod.id) &&
!_.isNil(mod.name)) {
this.store.dispatch( { type: VR_MODULE_ADDED, payload: mod });
return <IServiceMessage> {
id: '0000',
content: `Registered vr module '${mod.name}'`
};