Skip to content

Instantly share code, notes, and snippets.

NPM Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

##List of less common (however useful) NPM commands

######Install a package and also update package.json with the installed version and package name.

NPM Cheat Sheet

(Full description and list of commands at - https://npmjs.org/doc/index.html)

##List of less common (however useful) NPM commands

######Install a package and also update package.json with the installed version and package name.

{
"libs":[
"browser",
"chai",
"ecma5",
"ecma6",
"jquery",
"underscore"
],
"plugins": {
@vmlinz
vmlinz / .editorconfig
Created May 21, 2016 16:46
js and json editor config
root = true
[*]
insert_final_newline = true
charset = utf-8
trim_trailing_whitespace = true
end_of_line = lf
[*.{js,json}]
indent_style = space
@vmlinz
vmlinz / gist:98c4adceb5b1a9121c71b3a62f93b4a4
Created May 16, 2016 15:48 — forked from dodyg/gist:5616605
Kotlin Programming Language Cheat Sheet Part 2

This is a quick guide to Kotlin programming language. The previous part of this guide is here

#Object Oriented

fun main(args : Array<String>) {
  class local (val x : Int)
  
  val y = local(10)
 println("${y.x}")
@vmlinz
vmlinz / gist:26afd5f42d462b9142037819f99fcaff
Created May 16, 2016 15:47 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

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 kotlin.jetbrains.org.

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

Let's get started.

@vmlinz
vmlinz / local-properties-buildconfig.md
Last active March 18, 2016 11:14
Using local.properties file to store sensitive information in Android projects

问题

我们常常需要在Android工程里面放一些比较敏感的信息,比如某些三方服务的API Key之类的信息。但是设置到工程中每次手工修改代码又很麻烦,于是我查看了一些资料,实现了在local.properties这个文件中保存敏感信息。同时因为local.properties这个文件默认被gitignore了,相对来说还是比较安全。

操作方法

在工程根目录的local.properties里面填入你想保存的敏感信息

比如MyTMDBApiKey=xxxx

@vmlinz
vmlinz / periodic_sync_adapter.md
Created March 15, 2016 12:43
Udacity "Developing Android Apps" #Sheduled Synchronization instructor notes

Instructor Notes

Before completing the quiz above, make sure you have added the necessary code to configure periodic syncs.

The code in this video will create the logic to, when you start Sunshine, check if an account has been created for Sunshine and if not, create a new account and configure a periodic sync to start.

Instructions

FetchWeatherTask and the SunshineService are now just older, unused classes which do the same thing that the SunshineSyncAdapter class is doing now; remove them. Clean up the AndroidManifest.xml and remove SunshineService and the AlarmReciever from the xml.