Skip to content

Instantly share code, notes, and snippets.

View casprwang's full-sized avatar

Casper Wang casprwang

View GitHub Profile
WangSongdeMacBook-Air:~ wangsong$ npm install -g npm-check-updates
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
/usr/local/lib
├── abbrev@1.0.9
├── aproba@1.0.4
├─┬ fstream@1.0.10
│ ├── graceful-fs@4.1.4
│ ├── inherits@2.0.1
│ ├─┬ mkdirp@0.5.1
│ │ └── minimist@0.0.8
let dragon =
name =>
size =>
element =>
name + ' is a ' +
size + 'dragon that breaths ' +
element +'!'
var http = require('http');
var myServer = http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type" : "text/html"});
response.write('<h1>Roux Meetups</h1>');
response.end();
});
myServer.listen(3000);
console.log('Go to http://localhost:3000 on your browser');
snippet head "jekyll" b
---
layout: post
title: $1
date: `date +%Y-%m-%d`
categories:
- $2
tags:
- $3
---
try:
with open('python4.json', 'a') as f:
tweet = json.loads(data)
geo_data = {
"features": []
}
if tweet['place']:
geo_json_feature = {
"place": tweet['place'],
}
class MyListener(StreamListener):
def on_data(self, data):
try:
with open('python0.json', 'a') as f:
tweet = json.loads(data)
if tweet['coordinates']:
print(1)
f.write(data)
return True
import json
with open('python222.json', 'r') as f:
geo_data = {
"type": "FeatureCollection",
"features": []
}
for line in f:
tweet = json.loads(line)
if tweet['coordinates']:
geo_json_feature = {
var mystyle = {
"color": "#ff7800",
"weight": 5,
"opacity": 0.65
};
function popout(feature, layer) {
layer.bindpopup(`<h1>${feature.properties.name}</h1>\n<h3>${feature.properties.created_at.slice(0, 16)}</h3>\n<h2>${feature.properties.text}</h2>\n<h3>📍${feature.properties.location}</h3>`);
};
let mapleader="\<Space>"
set laststatus=2
set smartindent
" let foo=3
set expandtab
" set softtabstop=-2
" set tabstop=2
" set smarttab
" function source()
let categories = [
{id: 'animals', 'parent': null},
{id: 'mammals', 'parent': 'animals'},
{id: 'dogs', 'parent': 'animals'},
{id: 'chihuahua', 'parent': 'dogs'},
{id: 'labrador', 'parent': 'dogs'},
{id: 'persian', 'parent': 'cats'},
]