Skip to content

Instantly share code, notes, and snippets.

Sina Meraji sinameraji

Block or report user

Report or block sinameraji

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
@leon-sleepinglion
leon-sleepinglion / compound_interest_calculator.py
Created Mar 16, 2018
Coding for Economist Minds - Week 1
View compound_interest_calculator.py
#-------------------------------------------------------------------
# This is a compound interest calculator, along with some challenge
# Written by Leon Wee, March 2018.
# Anyone may freely copy or modify this program.
#-------------------------------------------------------------------
# C = P[(1+r)^n - 1]
# Where:
# C = the compound interest
# P = the principal investment amount (the initial deposit or loan amount)
@yjzhang
yjzhang / k_means.py
Last active Nov 10, 2018
basic python implementation of k-means and online k-means clustering
View k_means.py
# Online k-means algorithm
# see http://www.cs.princeton.edu/courses/archive/fall08/cos436/Duda/C/sk_means.htm
import numpy as np
def k_means(data, k, threshhold=2):
"""
Does k-means clustering of the data.
Args:
@btfak
btfak / useHexo.md
Created May 26, 2016
How to use Hexo and deploy to GitHub Pages
View useHexo.md
View maktabkhooneh.js
// https://maktabkhooneh.org/course/170/
[...document.querySelectorAll('.lesson-links')]
.map(x => () => fetch(x.href)
.then(x => x.text())
.then(x => new DOMParser().parseFromString(x, 'text/html').querySelector('#myplayer > source:nth-child(1)').src) // or (2)
.then(y => console.log(y, x.innerText.trim().replace(/ /g, '_') + '.mp4'))
)
.reduce((promise, next) => promise.then(next), Promise.resolve())
.then(() => console.log('Finished!'));
@PurpleBooth
PurpleBooth / README-Template.md
Last active Sep 20, 2019
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@aheinze
aheinze / gist:02db57da725cf7ba4047
Last active Mar 3, 2019
letterAvatar - create Letter avatar based on name initials
View gist:02db57da725cf7ba4047
/*
* LetterAvatar
*
* Create Letter avatar based on Initials -
* based on https://gist.github.com/leecrossley/6027780
*/
(function(w, d){
function LetterAvatar (name, size) {
@spacemonkey
spacemonkey / .gitignore
Created Jul 11, 2014
.gitignore for Hexo powered websites
View .gitignore
.DS_Store
Thumbs.db
db.json
debug.log
node_modules/
public/
.deploy/
themes/
View install-ebook-convert.md

Install cask that extends the brew command :

brew install phinze/cask/brew-cask

Install calibre using cask :

brew cask install calibre
@danharper
danharper / background.js
Last active Sep 15, 2019
Bare minimum Chrome extension to inject a JS file into the given page when you click on the browser action icon. The script then inserts a new div into the DOM.
View background.js
// this is the background code...
// listen for our browerAction to be clicked
chrome.browserAction.onClicked.addListener(function (tab) {
// for the current tab, inject the "inject.js" file & execute it
chrome.tabs.executeScript(tab.ib, {
file: 'inject.js'
});
});
You can’t perform that action at this time.