Skip to content

Instantly share code, notes, and snippets.

View inancgumus's full-sized avatar

İnanç Gümüş inancgumus

View GitHub Profile
'''
Euclide's Theorem 3.3 from Book IX
Finding perfect numbers.
Perfect number is a number that is the sum of its proper divisors.
Examples:
6 = 1 + 2 + 3
28 = 1 + 2 + 4 + 7 + 14
INFO global: Vagrant version: 1.7.2
INFO global: Ruby version: 2.0.0
INFO global: RubyGems version: 2.0.14
INFO global: VAGRANT_EXECUTABLE="/opt/vagrant/bin/../embedded/gems/gems/vagrant-1.7.2/bin/vagrant"
INFO global: VAGRANT_INSTALLER_EMBEDDED_DIR="/opt/vagrant/bin/../embedded"
INFO global: VAGRANT_INSTALLER_VERSION="2"
INFO global: VAGRANT_DETECTED_OS="Darwin"
INFO global: VAGRANT_INSTALLER_ENV="1"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
INFO global: VAGRANT_LOG="debug"
@inancgumus
inancgumus / builder pattern in javascript.js
Last active March 27, 2016 13:11
this pattern has usually been used in Java for testing. but, in javascript, it's very easy to do without the boilerplate code hassle.
// general helper to create the builder pattern automatically
var make = function(klass) {
return { with: function(extendWithThis) { return Object.assign(klass, extendWithThis) } }
}
// let's make a spaghetti
var Pasta = { ingredients: [] }
var spaghetti = make(Pasta).with({
ingredients: [ 'mashroom', 'onion' ]
@inancgumus
inancgumus / App.js
Created April 16, 2016 18:10 — forked from jesseditson/App.js
ES6 & React Sticky scroll higher-order component example
import React from 'react'
import MyComponent from '../components/MyComponent'
export default class App extends React.Component {
render() {
return <MyComponent topMargin="10"/>
}
}
@inancgumus
inancgumus / readability.js
Created August 12, 2016 20:29 — forked from jakedahn/readability.js
Readability.js
/*jslint undef: true, nomen: true, eqeqeq: true, plusplus: true, newcap: true, immed: true, browser: true, devel: true, passfail: false */
/*global window: false, readConvertLinksToFootnotes: false, readStyle: false, readSize: false, readMargin: false, Typekit: false, ActiveXObject: false */
var dbg = (typeof console !== 'undefined') ? function(s) {
console.log("Readability: " + s);
} : function() {};
/*
* Readability. An Arc90 Lab Experiment.
* Website: http://lab.arc90.com/experiments/readability
@inancgumus
inancgumus / _.md
Created August 26, 2016 23:51
test
@inancgumus
inancgumus / index.html
Last active August 26, 2016 23:56 — forked from anonymous/index.html
d3 scatterplot experiment // source http://jsbin.com/zizunel
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>d3 starter kit</title>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.2.2/d3.js"></script>
<style id="jsbin-css">
/* Styles go here */
@inancgumus
inancgumus / # postgresql - 2016-12-08_20-57-24.txt
Created December 8, 2016 18:04
postgresql on macOS 10.12.1 - Homebrew build logs
Homebrew build logs for postgresql on macOS 10.12.1
Build date: 2016-12-08 20:57:24
#!/usr/bin/env bash
#Code adapted from https://gist.github.com/yangj1e/3641843c758201ebbc6c (Modified to Python3.5)
cd ~
#wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda2-2.4.0-Linux-x86_64.sh
wget https://3230d63b5fc54e62148e-c95ac804525aac4b6dba79b00b39d1d3.ssl.cf1.rackcdn.com/Anaconda3-2.4.1-Linux-x86_64.sh
bash Anaconda3-2.4.1-Linux-x86_64.sh -b
echo 'PATH="/home/ubuntu/anaconda3/bin:$PATH"' >> .bashrc
. .bashrc
==> default: Configuring cache buckets...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
rm -rf /home/vagrant/.npm
Stdout from the command: