Skip to content

Instantly share code, notes, and snippets.

View alexeygrigorev's full-sized avatar
:octocat:
Githubbing

Alexey Grigorev alexeygrigorev

:octocat:
Githubbing
View GitHub Profile
@ziritrion
ziritrion / dezoomcamp-vm.md
Last active July 13, 2024 10:48
Quick guide to easily create a VM instance in GCP and set up SSH access with Gcloud SDK

Install and setup Gcloud SDK

  1. Download Gcloud SDK from this link and install it according to the instructions for your OS.
  2. Initialize the SDK following these instructions.
    1. Run gcloud init from a terminal and follow the instructions.
    2. Make sure that your project is selected with the command gcloud config list

Creating a VM instance

  1. From your project's dashboard, go to Cloud Compute > VM instance
@alefesta
alefesta / install.sh
Last active November 8, 2021 14:52
A simple gist to setup a standard environment
!#/bin/bash
sudo add-apt-repository universe
sudo apt update
sudo apt install --yes powerline vim git
echo "
# Powerline configuration
if [ -f /usr/share/powerline/bindings/bash/powerline.sh ]; then
powerline-daemon -q
@DavidWells
DavidWells / aws-lambda-redirect.js
Created June 28, 2018 20:48
How to do a 301 redirect from an AWS lambda function
exports.handler = (event, context, callback) => {
const response = {
statusCode: 301,
headers: {
Location: 'https://google.com',
}
};
return callback(null, response);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sswt
sswt / eval_map
Created January 23, 2017 19:59
Outbrain map@12 evaluation
def eval_map(yhat, dtrain):
inds = (-yhat).argsort(kind='mergesort')
X = np.vstack([dtrain.data['display_id'], dtrain.get_label()]).T
X = X[inds[X[inds, 0].argsort(kind='mergesort')]]
y_ind = np.where(X[:, 1] == 1)[0]
y_pr = np.unique(X[:, 0], return_index=True)[1]
return 'map@12_ob', np.mean(1 / (y_ind - y_pr + 1)), True
@ld86
ld86 / spirals.ipynb
Created June 30, 2016 12:12
How to generate spirals dataset.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chenjianjx
chenjianjx / start-celery-for-dev.py
Created March 10, 2016 10:45
A python script which starts celery worker and auto reload it when any code change happens.
'''
A python script which starts celery worker and auto reload it when any code change happens.
I did this because Celery worker's "--autoreload" option seems not working for a lot of people.
'''
import time
from watchdog.observers import Observer ##pip install watchdog
from watchdog.events import PatternMatchingEventHandler
import psutil ##pip install psutil
import os
@lmarkus
lmarkus / README.MD
Last active October 3, 2024 18:13
Extracting / Exporting custom emoji from Slack

Extracting Emoji From Slack!

Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.

If you're an admin of your own team, you can get the list of emoji directly using this API: https://api.slack.com/methods/emoji.list. Once you have it, skip to Step 3

HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.

Follow along...

@darribas
darribas / panel_FE.ipynb
Last active January 10, 2021 18:41
Fixed-Effects panel OLS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@damianavila
damianavila / remove_output.py
Created April 3, 2013 22:05
Remove output from IPython notebook from the command line (dev version 1.0)
"""
Usage: python remove_output.py notebook.ipynb [ > without_output.ipynb ]
Modified from remove_output by Minrk
"""
import sys
import io
import os
from IPython.nbformat.current import read, write