Skip to content

Instantly share code, notes, and snippets.


chenrui chenrui333

Block or report user

Report or block chenrui333

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
DanHerbert /
Last active Oct 19, 2019
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.


This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

dodyg / gist:5823184
Last active Oct 5, 2019
Kotlin Programming Language Cheat Sheet Part 1
View gist:5823184


Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

visenger /
Last active Feb 14, 2019
Scala and sbt installation on ubuntu 12.04
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
sudo dpkg -i scala-2.11.4.deb
sudo apt-get update
anonymous / solution.scala
Created Apr 8, 2013
Solve 10 problems of eulerproject using 20 lines scala code
View solution.scala
import collection._
import Stream._
implicit class D(n: Int) {
def fs = (1 until n) filter (n%_ == 0) sum // sum of n's proper divisors
val r = mutable.Map[Int, Any]() // to store the result
val num = from(0) //all non-negative integer numbers
def isprime(n: Int) = BigInt(n) isProbablePrime 10
You can’t perform that action at this time.