Skip to content

Instantly share code, notes, and snippets.

View vladinator1000's full-sized avatar
๐Ÿ‰

Vlady Veselinov vladinator1000

๐Ÿ‰
View GitHub Profile
@vladinator1000
vladinator1000 / GAplatoe.py
Created October 2, 2017 15:24
so QUESTION
Hi, I'm trying to generate "Hello world!", but my results stop improving strings reach roughly about 70% similarity. Here's what I've done:
from difflib import SequenceMatcher
from numpy import std
from random import randint
import random
from pprint import pprint
GENES = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!."
TARGET = "Hello World!"
@vladinator1000
vladinator1000 / generative-hello.py
Last active October 2, 2017 15:25
Genetic algorithm generating "Hello world!"
from difflib import SequenceMatcher
from jellyfish import levenshtein_distance, jaro_distance, damerau_levenshtein_distance
from numpy import std, clip
from random import randint
import random
from pprint import pprint
GENES = " abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!."
TARGET = "Hello World!"
@vladinator1000
vladinator1000 / renameByDirectory.py
Last active June 26, 2017 03:53
Makes a .csv file with a row of file names per subdirectory and appends "directoryName_" to each file
import os
from glob import glob
from os import rename, listdir
# Makes a .csv file with a row of file names per subdirectory
# Appends "directoryName_" to each file
# Get the script directory path
path = os.path.dirname(os.path.realpath(__file__))
folderName = os.path.basename(path)
@vladinator1000
vladinator1000 / NginxConfigDefault
Created April 30, 2017 06:57
Trying to get subdomains to work with SSL: /etc/nginx/sites-enabled/default
server {
listen 80;
listen [::]:80 yupty.vladyv.me ipv6only=on;
return 301 https://yupty.vladyv.me$request_uri;
}
server {
# Enable HTTP/2
listen 443 ssl http2;
listen [::]:443 ssl http2;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ACPI</key>
<dict>
<key>DSDT</key>
<dict>
<key>Debug</key>
<false/>
@vladinator1000
vladinator1000 / outline.cs
Last active December 15, 2016 03:22
Adding an outline on hover in the Unity game engine
using UnityEngine;
using System.Collections;
public class rayCast : MonoBehaviour {
public GameObject hoveredObject;
public float selectRange = 50f;
public float hitForce = 100f;
public Camera fpCamera;
public Material hoveredMaterial;
@vladinator1000
vladinator1000 / WaitUntilInputStopsThenDoSomething.js
Last active December 9, 2016 00:02
Wait for input to stop before doing something. Might be useful for searching or tagging in React.
// See it in action: http://i.imgur.com/AvhOdss.gifv
// Inspired by https://schier.co/blog/2014/12/08/wait-for-user-to-stop-typing-using-javascript.html
import React from 'react';
export default class WaitUntilInputStopsThenDoSomething extends React.Component {
constructor(props) {
super(props);
this.doSomething = this.doSomething.bind(this);
}
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Inventory : MonoBehaviour {
InventoryDatabase database;
GameObject inventoryPanel;
public GameObject inventoryItem;
@vladinator1000
vladinator1000 / example_onset_detection.py
Last active November 1, 2016 18:04
How to get onsets from audio using Essentia
# Onsets look like this (the red parts in the photo): http://i.stack.imgur.com/vYa0v.jpg
import sys
from essentia import Pool, array
from essentia.standard import *
# In this example we are going to look at how to perform some onset detection
# and mark them on the audio using the AudioOnsetsMarker algorithm.
#
def doesStringContainLetter(letter, string):
for char in string:
if letter in char:
print letter
return letter
else:
print "Didn't find the letter you're looking for"