Skip to content

Instantly share code, notes, and snippets.

View brakmic's full-sized avatar
🏠

Harris Brakmić brakmic

🏠
View GitHub Profile
@brakmic
brakmic / json_stringify_circular_for_angular.js
Last active July 31, 2017 12:22
AngularJS-Module: Stringify JSON Objects with circular dependencies
(function () {
/* converted by @brakmic */
/* original code: https://github.com/isaacs/json-stringify-safe */
/* usage example:
*
*angular.module("myModule", ['jsonStringify'])
* .controller("MainCtrl", ['StringifyJsonService', MainCtrl]);
*
@brakmic
brakmic / msbuild_and_webpack_with_gulp.js
Last active January 20, 2021 14:28
Visual Studio (MSBuild) + Webpack + LiveReload with Gulp
/* jshint strict : false */
var gulp = require('gulp');
var gutil = require('gulp-util');
var plumber = require('gulp-plumber');
var webpack = require('webpack');
var msbuild = require("gulp-msbuild");
var nodemon = require('nodemon');
var webpackConfigPath = require('./webpack.config');
var vsSolutionPath = 'PATH_TO_VISUAL_STUDIO_SOLUTION';
var watchPaths = [
//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));
}