Skip to content

Instantly share code, notes, and snippets.

Kyriakos Chatzidimitriou kyrcha

Block or report user

Report or block kyrcha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kyrcha
kyrcha / graphqlclient.go
Last active Oct 14, 2019
Performing GraphQL queries (to GiHub) using the barebones http.Client in Go
View graphqlclient.go
package main
import (
"context"
"encoding/json"
"fmt"
"net/http/httputil"
"os"
"strings"
@kyrcha
kyrcha / pandas-to-tensor.py
Created Jul 16, 2019
Converting a pandas dataframe with each row being a vector image to a 4D tensor for CNN use in Keras
View pandas-to-tensor.py
# Transforming a 60000x784 dataframe to a 60000x28x28x1 4D tensor for Keras modelling
train_img = X_train.values.reshape(X_train.shape[0], 28, 28, 1)
@kyrcha
kyrcha / zipballs-downloader.js
Last active Jun 11, 2019
Downloading tarballs (or zipballs) using JavaScript async/await, the `Get archive link` of the GitHub Contents API, the octokit/rest.js client and the request library
View zipballs-downloader.js
const Octokit = require('@octokit/rest')
const rp = require('request-promise')
const fs = require('fs')
function sleep (ms) {
return new Promise(resolve => setTimeout(resolve, ms))
}
const baseUrl = 'https://api.github.com'
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN })
@kyrcha
kyrcha / .editorconfig
Created Apr 12, 2019
My editor config file for Visual Studio Code. Put it in the root of your project. Go to the preferences of VSC > Keyboard Shortcuts. Search for document format shorcut. Open a file. Use that shorcut and your document should be formatted.
View .editorconfig
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
@kyrcha
kyrcha / running-average-redis-python.py
Last active Apr 4, 2019
Calculate the running average and standard deviation using redis transactions (pipelines in python-reids) and multiple python threads. You can quickly test it by installing a dockerized redis.
View running-average-redis-python.py
from multiprocessing import Pool
import redis
import math
import json
from random import seed
from random import gauss
# Atomic operations
def sum(x):
r = redis.Redis(host='localhost', port=6379, db=0)
@kyrcha
kyrcha / .cyclopt.json
Last active Mar 19, 2019
Configure your .cyclopt.json to ignore files and folders. This is what we use as our basis. Supports minimatch patterns https://github.com/isaacs/minimatch#usage
View .cyclopt.json
{
"ignore": [
"**/deps/**",
"**/node_modules/**",
"**/thirdparty/**",
"**/third_party/**",
"**/bower_components/**",
"**/vendor/**",
"**/vendors/**",
"**/**-min-**",
@kyrcha
kyrcha / README.md
Last active Aug 21, 2018
Spin mongodb with mongo express using docker compose
View README.md

Accessible from the web: http://hostname:8081 through mongo-express and you can connect with a mongodb client like robo 3T in hostname:27017.

To run:

 docker-compose -f mongo.yml up
@kyrcha
kyrcha / anaconda.md
Last active Jan 3, 2019
Anaconda commands
View anaconda.md

Checkout all the packages in the default conda environment:

conda list

Upgrading conda and packages:

conda upgrade conda
conda upgrade --all

Installing packages examples:

@kyrcha
kyrcha / README.md
Created Dec 17, 2017
Deep Learning with Python and Anaconda
View README.md

Instructions of how to set-up environments etc.

@kyrcha
kyrcha / README.md
Last active Jan 11, 2017
Deploying a node app with flightplan
View README.md

Complete guide on how to deploy a node app in an Ubuntu server using flightplan can be found here:

You can’t perform that action at this time.