Skip to content

Instantly share code, notes, and snippets.

View RANUX's full-sized avatar
🏠
👉JavaScript dev. Open for job offerings

Alexander RANUX

🏠
👉JavaScript dev. Open for job offerings
View GitHub Profile
@RANUX
RANUX / 2-layer-nn.py
Created November 23, 2017 13:15
Very simple 2 layer neural network
import numpy as np
import math
inp = np.matrix([[1.0], [0.5]])
weights = np.matrix([[0.9, 0.3],[0.2,0.8]])
x = weights.dot(inp)
sigmoid = np.vectorize(lambda x: 1 / (1 + math.exp(-x)))
sigmoid(x)
#out.append(sigmoid(np.array(wsum)[0]))
@RANUX
RANUX / cors.nginxconf
Created September 22, 2017 13:45 — forked from pauloricardomg/cors.nginxconf
Nginx configuration for CORS-enabled HTTPS proxy with origin white-list defined by a simple regex
#
# Acts as a nginx HTTPS proxy server
# enabling CORS only to domains matched by regex
# /https?://.*\.mckinsey\.com(:[0-9]+)?)/
#
# Based on:
# * http://blog.themillhousegroup.com/2013/05/nginx-as-cors-enabled-https-proxy.html
# * http://enable-cors.org/server_nginx.html
#
server {
@RANUX
RANUX / media-queries.scss
Created July 16, 2017 11:20 — forked from chrisl8888/media-queries.scss
All Media Queries breakpoints
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
@RANUX
RANUX / android_instructions.md
Created June 28, 2017 11:47 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@RANUX
RANUX / purgeAndroid.txt
Created June 21, 2017 13:15 — forked from tahmidsadik/purgeAndroid.txt
How to completely remove Android Studio from Mac OS X
How to Completely Remove Android Studio
Execute these commands from the terminal
rm -Rf /Applications/Android\ Studio.app
rm -Rf ~/Library/Preferences/AndroidStudio*
rm ~/Library/Preferences/com.google.android.studio.plist
rm -Rf ~/Library/Application\ Support/AndroidStudio*
rm -Rf ~/Library/Logs/AndroidStudio*

after install neovim nvim config file folder ~/.config/nvim

git clone https://github.com/VundleVim/Vundle.vim.git ~/.config/nvim/bundle/Vundle.vim
ln -s ~/.vimrc ~/.config/nvim/init.vim
vim ~/.vimrc
set nocompatible              " be iMproved, required

filetype off " required

@RANUX
RANUX / homebrew-rvm.md
Created May 10, 2017 14:11 — forked from denji/homebrew-rvm.md
Homebrew + RVM > Awesome

The MBP is my development machine, so I needed all of my tools installed with the ability to update them with ease. In the past, I used MacPorts to take care of my MySQL, Memcached, and Ruby installions and it worked just fine. This time around however, I wanted something new and fun. Homebrew.

Homebrew is a new package manager for OS X. Unlike Fink or MacPorts, Homebrew integrates with the core operating system, reducing the number of extra libraries to install etc. Another neat feature is the ability to write software package recipes in Ruby, awesome.

Here are some raw installation instructions (clean system). I like to keep everything under user ownership to make life more enjoyable, say no to sudo.

You will need the latest version of xcode, you can get it here. After the installation is complete, you may continue.

sudo mkdir /usr/local
@RANUX
RANUX / _custom_grid.sass
Created May 9, 2017 15:25
Simple custom css grid
// Based on https://css-tricks.com/dont-overthink-it-grids/
$pad: 5px
$total-columns: 12
$column-width: 100 / $total-columns
// Column size in percents
// $n - col num
@function grid-column-width($n)
@return ($column-width * $n * 1%)
@RANUX
RANUX / get-vk-groups-urls.js
Last active February 6, 2017 14:27
Get VK group urls in Browser Dev Console
var element1 = document.createElement("script");element1.src = "//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js";element1.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(element1);
var list = [];
$('.labeled>a').each(function(i){
list.push(this.pathname.slice(1));
})
list.forEach(item => {
console.log(item)
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->