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 / 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 / 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 / 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 / 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 / 3-layer-nn.py
Created November 23, 2017 14:10
Simple neural network with 3 layers
import numpy as np
import math
inp = np.matrix([[0.9], [0.1], [0.8]])
wInp = np.matrix([[0.9, 0.3, 0.4],[0.2,0.8, 0.2],[0.1,0.5,0.6]])
xHid = wInp.dot(inp)
sigmoid = np.vectorize(lambda x: 1 / (1 + math.exp(-x)))
outHid = sigmoid(xHid)
@RANUX
RANUX / cloudSettings
Last active January 10, 2019 08:38
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-01-10T08:38:13.438Z","extensionVersion":"v3.2.4"}
@RANUX
RANUX / md2pdf.spy
Created February 24, 2018 21:01
Compile *.md files to single or multiple pdf files with Python
import sys
import os
import re
from shellpython.helpers import Dir
'''
Compile *.md files to single or multiple pdf files
Requirments:
Python 3
@RANUX
RANUX / fib-fact-iterator.js
Created March 16, 2018 08:45
Fibonaci and factorial iterators on JavaScript
var Fib = {
[Symbol.iterator]() {
var n1 = 1, n2 = 1;
return {
// make the iterator an iterable
[Symbol.iterator]() { return this; },
next() {
var current = n2;
@RANUX
RANUX / range.js
Created March 16, 2018 14:14
Range function for JavaScript
function *range(start, end, step=1) {
let i = start;
while ( i < end ) {
yield i;
i += step;
}
}
[...range(0,5)].map(x => x*2);
@RANUX
RANUX / 18-challange-styles.css
Created March 16, 2018 19:27
Styles from task
html,
body {
margin: 0;
padding: 0;
}
body {
width: 280px;
min-height: 250px;
padding-top: 50px;