Skip to content

Instantly share code, notes, and snippets.

🕶
busy, busy

Mike Bijon mbijon

🕶
busy, busy
Block or report user

Report or block mbijon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mbijon
mbijon / nginx.conf
Last active Mar 5, 2019 — forked from Stanback/nginx.conf
Partial Nginx configuration to add CORS-support to a proxied Grape/Rails/Passenger APIs
View nginx.conf
#
# CORS-header support example while nginx proxies Rails/Grape + Passenger
# ...not a complete config file
#
server {
listen 443 ssl;
root /foo/public;
# Modify for API-specific
try_files $uri/index.html $uri @passenger;
@mbijon
mbijon / umap_sparse.py
Created Aug 22, 2018 — forked from johnhw/umap_sparse.py
1 million prime UMAP layout
View umap_sparse.py
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random
View keybase.md

Keybase proof

I hereby claim:

  • I am mbijon on github.
  • I am mbijon (https://keybase.io/mbijon) on keybase.
  • I have a public key ASDneF_5-coE6CEyRCzP3YMftB04es5vID21FVADl4k39go

To claim this, I am signing this object:

@mbijon
mbijon / gist:2ddf2bfecd58e4921c1350f495261a80
Created Jun 20, 2017 — forked from byu/gist:99651
Ruby AES Encryption using OpenSSL
View gist:2ddf2bfecd58e4921c1350f495261a80
#!/usr/bin/env ruby
require "openssl"
require 'digest/sha2'
require 'base64'
# We use the AES 256 bit cipher-block chaining symetric encryption
alg = "AES-256-CBC"
# We want a 256 bit key symetric key based on some passphrase
digest = Digest::SHA256.new
@mbijon
mbijon / gist:5116961cdb728bcaa006a9932d42cb2d
Created Jun 20, 2017 — forked from byu/gist:99651
Ruby AES Encryption using OpenSSL
View gist:5116961cdb728bcaa006a9932d42cb2d
#!/usr/bin/env ruby
require "openssl"
require 'digest/sha2'
require 'base64'
# We use the AES 256 bit cipher-block chaining symetric encryption
alg = "AES-256-CBC"
# We want a 256 bit key symetric key based on some passphrase
digest = Digest::SHA256.new
@mbijon
mbijon / xcode8.js
Created Apr 17, 2017 — forked from dpogue/xcode8.js
Hook for Cordova iOS to support "developmentTeam" in buildConfig.json
View xcode8.js
"use strict";
var fs = require('fs');
var path = require('path');
module.exports = function(context) {
var encoding = 'utf-8';
var filepath = 'platforms/ios/cordova/build.xcconfig';
if (context.opts.cordova.platforms.indexOf('ios') === -1) return;
@mbijon
mbijon / xcode8.js
Created Apr 17, 2017 — forked from dpogue/xcode8.js
Hook for Cordova iOS to support "developmentTeam" in buildConfig.json
View xcode8.js
"use strict";
var fs = require('fs');
var path = require('path');
module.exports = function(context) {
var encoding = 'utf-8';
var filepath = 'platforms/ios/cordova/build.xcconfig';
if (context.opts.cordova.platforms.indexOf('ios') === -1) return;
@mbijon
mbijon / gist:13798111e7bf56f2268626c4e1d21b07
Created Jan 26, 2017 — forked from mattconnolly/gist:4158961
RSpec basic authentication helper module for request and controller specs
View gist:13798111e7bf56f2268626c4e1d21b07
module AuthHelper
def http_login
user = 'username'
pw = 'password'
request.env['HTTP_AUTHORIZATION'] = ActionController::HttpAuthentication::Basic.encode_credentials(user,pw)
end
end
module AuthRequestHelper
#
View optional-polyfill.js
var scripts = ['app.a700a9a3e91a84de5dc0.js']; // script for all users
var newBrowser = (
'fetch' in window &&
'Promise' in window &&
'assign' in Object &&
'keys' in Object
);
if (!newBrowser) {
@mbijon
mbijon / juggernaut.rb
Created Dec 22, 2016 — forked from maccman/juggernaut.rb
Sinatra Server Side Event streaming.
View juggernaut.rb
# Usage: redis-cli publish message hello
require 'sinatra'
require 'redis'
conns = []
get '/' do
erb :index
end
You can’t perform that action at this time.