Skip to content

Instantly share code, notes, and snippets.

View UmutAlihan's full-sized avatar

Alihan UmutAlihan

  • Istanbul, Turkey
View GitHub Profile
from gensim.models import KeyedVectors
# Load gensim word2vec
w2v_path = '<Gensim File Path>'
w2v = KeyedVectors.load_word2vec_format(w2v_path)
import io
# Vector file, `\t` seperated the vectors and `\n` seperate the words
"""
@candlewill
candlewill / keras_models.md
Last active December 9, 2022 02:43
A collection of Various Keras Models Examples

Keras Models Examples

一系列常用模型的Keras实现

DNN

Multilayer Perceptron (MLP) for multi-class softmax classification

from keras.models import Sequential
@darencard
darencard / auto_git_file.md
Last active February 9, 2025 12:05
Automatic file git commit/push upon change

Please see the most up-to-date version of this protocol on my blog at https://darencard.net/blog/.

Automatically push an updated file whenever it is changed

Linux

  1. Make sure inotify-tools is installed (https://github.com/rvoicilas/inotify-tools)
  2. Configure git as usual
  3. Clone the git repository of interest from github and, if necessary, add file you want to monitor
  4. Allow username/password to be cached so you aren't asked everytime
<#
.Synopsis
Get a Quote for any topc
.DESCRIPTION
Get-Quote cmdlet data harvests a/multiple quote(s) from Web outputs into your powershell console
.EXAMPLE
PS > Quote -Topic "success"
For me success was always going to be a Lamborghini. But now I've got it, it just sits on my drive.
Curtis Jackson [50 Cent], American Rapper. From his interview with Louis Gannon for Live magazine, The Mail on Sunday (UK) newspaper, (25 October 2009).
.EXAMPLE
@revolunet
revolunet / 0-raspi-cheatsheet-intro.md
Last active March 14, 2020 10:07
Raspberry PI 3 cheat sheet
@LarsBergqvist
LarsBergqvist / automation.yaml
Last active November 8, 2021 18:02
Home Assistant automation for turning lights on and off based on sunset and sunrise
automation:
- alias: Turn on garden lights when sun sets
trigger:
platform: sun
event: sunset
action:
service: switch.turn_on
entity_id: switch.garden_lights
- alias: Turn off garden lights when sun rises
@saucecode
saucecode / my_flask_program.py
Created December 31, 2016 06:50
how to correctly use a letsencrypt cert with flask
...
from OpenSSL import SSL
...
context = SSL.Context(SSL.TLSv1_2_METHOD)
context.use_privatekey_file('/etc/letsencrypt/live/DOMAIN.COM/privkey.pem')
context.use_certificate_chain_file('/etc/letsencrypt/live/DOMAIN.COM/fullchain.pem')
context.use_certificate_file('/etc/letsencrypt/live/DOMAIN.COM/cert.pem')
@vfdev-5
vfdev-5 / Create_a_hotspot.md
Last active January 15, 2021 15:52
Raspberry Pi - Ubuntu 16.04 Mate - Wifi automatic connection and static IP in terminal
sudo nmcli dev wifi hotspot ifname wlan0 con-name "my-hotspot" ssid "my-hotspot" password "My HotsPoT Strong Password"

More info here

@jamsinclair
jamsinclair / aws-minecraft-setup.sh
Last active May 24, 2022 05:25
A bash script to setup a simple Minecraft Server on an AWS Micro EC2 Instance. Installs server, configures cron to run server on reboot, adds some aliases for easy stop/start of minecraft server.
#!/bin/sh
runMinecraftCommand="java -Xms256M -Xmx768M -jar minecraft_server.jar nogui"
startScript="start.sh"
echo "Great let's get minecraft setup!"
# Sanity check, do we have java installed?
if ! hash java 2>/dev/null; then
echo "You don't have java installed. You're gonna have a tough time."
echo "Are you sure you selected the default Amazon Linux HVM ami?"
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm