Skip to content

Instantly share code, notes, and snippets.

View nikitalpopov's full-sized avatar
📷
watchin' you

Nikita Popov nikitalpopov

📷
watchin' you
View GitHub Profile
@stollcri
stollcri / c41lab
Last active June 16, 2024 11:08
A script which uses ImageMagick to develop scans of C-41 film negatives into color-corrected positive images
#!/bin/bash
# ====================================================================================================================
#
# Converted for bash by @stollcri (stollcri at gmail dot com), 2020-07-28
#
# Originally downloaded from: https://sites.google.com/site/c41digitallab/the-complexity
#
# ====================================================================================================================
# C41LAB - Version 1.2
#
@NigelEarle
NigelEarle / Knex-Migrations-Seeding.md
Last active June 19, 2024 14:20
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

from sklearn.feature_extraction.text import CountVectorizer
import numpy as np
import pandas as pd
import scipy as sp
posts = pd.read_csv('posts.csv')
# Create vectorizer for function to use
vectorizer = CountVectorizer(binary=False)
y = posts["score"].values.astype(np.float32)
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@nrollr
nrollr / MongoDB_macOS_Sierra.md
Last active April 1, 2024 16:23
Install MongoDB on Sierra using Homebrew

Install MongoDB on macOS Sierra

This procedure explains how to install MongoDB using Homebrew on macOS Sierra 10.12.
Official MongoDB install documentation: here

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@staringispolite
staringispolite / asciiputsonglasses
Last active May 27, 2024 09:28
Ascii art sunglasses meme
Puts on glasses:
(•_•)
( •_•)>⌐■-■
(⌐■_■)
Takes off glasses ("mother of god..."):
(⌐■_■)
( •_•)>⌐■-■
@nelanka
nelanka / Default (OS X).sublime-keymap
Last active November 15, 2019 03:10
Sublime Text 3 - User Key Bindings (IntelliJ IDEA Style) - OS X
[
{ "keys": ["super+y"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} },
// { "keys": ["super+d"], "command": "duplicate_line" }, -- Default is super+shift+D
{ "keys": ["super+`"], "command": "toggle_side_bar" },
{ "keys": ["super+shift+up"], "command": "swap_line_up" },
{ "keys": ["super+shift+down"], "command": "swap_line_down" },
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" },
{ "keys": ["alt+m"], "command": "markdown_preview", "args": {"target": "browser", "parser":"markdown"} }
]
@nihilismus
nihilismus / conky-cmus.py
Last active December 12, 2020 11:49
A Python script to get artist, album and title from cmus and send it to stdout. Useful for conky
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# For conky's configuration file ($HOME/.conkyrc):
# ${if_running cmus}
# ${execi 03 (conky-cmus.py)}
# ${endif}
from subprocess import check_output
from re import match, compile
@willurd
willurd / web-servers.md
Last active July 22, 2024 15:25
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@xeBuz
xeBuz / playcounts.py
Last active February 13, 2018 13:28
Get artists and tracks w/playcounts form Lastfm user.
#!/usr/bin/python2
# -*- coding: utf-8 -*-
import pylast
api_key = '189c5354198342a01be847e595afbb14'
username = 'eikiu'
api = pylast.LastFMNetwork(api_key = api_key)
user = pylast.User(username, api)
library = user.get_library()