Skip to content

Instantly share code, notes, and snippets.

View bitsnaps's full-sized avatar
🌍
Working @ CorpoSense

Ibrahim H. bitsnaps

🌍
Working @ CorpoSense
View GitHub Profile
@bitsnaps
bitsnaps / GMahout.groovy
Last active November 29, 2016 14:19 — forked from rahulsom/Ele.groovy
Mahout with Groovy - the faster way
@Grab(group = 'org.apache.mahout', module = 'mahout-core', version = '0.9')
import org.apache.mahout.cf.taste.impl.common.FastByIDMap
import org.apache.mahout.cf.taste.impl.common.FastIDSet
import org.apache.mahout.cf.taste.impl.model.file.FileDataModel
import org.apache.mahout.cf.taste.impl.recommender.GenericItemBasedRecommender
import org.apache.mahout.cf.taste.impl.similarity.TanimotoCoefficientSimilarity
//you can get this data from here: http://files.grouplens.org/datasets/movielens/ml-100k.zip
def mlDir = new File(getClass().protectionDomain.codeSource.location.path).parent+'/ml-100k'
@bitsnaps
bitsnaps / TikaMetadataExtractor.groovy
Created June 19, 2019 21:04 — forked from kaimst/TikaMetadataExtractor.groovy
A Groovy script that extracts metadata from files using Apache Tika. Works recursively on a file hierarchy and writes all found metadata into a single xml file.
/**
* Copyright 2013 Kai Sternad
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@bitsnaps
bitsnaps / odoo9-install.sh
Last active April 13, 2023 16:24 — forked from bistaray/Install Odoo v9 YENTHE
Ubuntu Scripts Installing Odoo v9
#!/bin/bash
################################################################################
# Script for installing Odoo on Ubuntu 14.04, 15.04 and 16.04 (could be used for other version too)
# Author: Yenthe Van Ginneken
#-------------------------------------------------------------------------------
# This script will install Odoo on your Ubuntu 14.04 server. It can install multiple Odoo instances
# in one Ubuntu because of the different xmlrpc_ports
#-------------------------------------------------------------------------------
# Make a new file:
# sudo nano odoo-install.sh
@bitsnaps
bitsnaps / webrtc.js
Created May 20, 2020 16:41 — forked from tauren/webrtc.js
Using RxJS for WebRTC icecandidate handling via WebSocket signaling server
// Create WebRTC peer and setup event handlers
let peer = new RTCPeerConnection(iceConfig)
// Subject for the websocket signalling server
let socketSubject = Observable.webSocket({
// deserialize each binary message received
resultSelector: e => deserialize(e.data)
})
// Filter for only icecandidate messages
.filter(msg => msg && msg.header && msg.header.event === 'icecandidate' && msg.body && msg.body.candidate)
@bitsnaps
bitsnaps / ubuntu-20.04-lts-perfect-setup.sh
Created July 19, 2020 16:28 — forked from eRQee/ubuntu-20.04-lts-perfect-setup.sh
Ubuntu 20.04 LTS Apps Server Installation Wizard
clear
##############
# Am I root? #
##############
if [ "x$(id -u)" != 'x0' ]; then
echo 'Error: this script can only be executed by root.'
echo 'Try re-run the script after switched to root account by type "sudo su"'
exit 1
fi
@bitsnaps
bitsnaps / App.vue
Created May 7, 2022 16:43 — forked from bricksroo/App.vue
Reveal.js in Vue
<template>
<div id="app">
<!-- <img src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/> -->
<div class="reveal">
<div class="slides">
<section>Single Horizontal Slide</section>
<section>
<section>Vertical Slide 1</section>
<section>Vertical Slide 2</section>
@bitsnaps
bitsnaps / gist_to_github_repo.md
Last active July 12, 2022 22:32 — forked from ishu3101/gist_to_github_repo.md
Transfer a gist to a GitHub repository

Transfer a gist to a GitHub repository

clone the gist

git clone https://gist.github.com/ishu3101/6fb35afd237e42ef25f9

rename the directory

mv 6fb35afd237e42ef25f9 ConvertTo-Markdown

change the working directory to the newly renamed directory

cd ConvertTo-Markdown

@bitsnaps
bitsnaps / plot_rbm_logistic_classification.py
Last active July 29, 2022 05:45 — forked from understar/plot_rbm_logistic_classification.py
scikit-learn RBM feature extraction and logistic classification
"""
Update: (07.29.2022): Fix: train_test_split import
==============================================================
Restricted Boltzmann Machine features for digit classification
==============================================================
For greyscale image data where pixel values can be interpreted as degrees of
blackness on a white background, like handwritten digit recognition, the
Bernoulli Restricted Boltzmann machine model (:class:`BernoulliRBM
<sklearn.neural_network.BernoulliRBM>`) can perform effective non-linear
@bitsnaps
bitsnaps / upper_confidence_bound.py
Last active July 30, 2022 14:08 — forked from devamitranjan/UCB.py
Upper Confidence Bound Implementation
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import math
class UpperConfidenceBound:
def __init__(self, dataframe, N, m):
self.__dataset = dataframe
self.__N = N
self.__m = m
@bitsnaps
bitsnaps / base64coding.groovy
Created September 24, 2022 09:45 — forked from mujahidk/base64coding.groovy
Base64 encoding and decoding in Groovy.
def text = "Going to convert this to Base64 encoding!"
// Encode
def encoded = text.bytes.encodeBase64().toString()
println encoded
// Decode
byte[] decoded = encoded.decodeBase64()
println new String(decoded)