Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View surmon-china's full-sized avatar
🧘‍♂️

Surmon surmon-china

🧘‍♂️
View GitHub Profile
@surmon-china
surmon-china / README.md
Last active June 5, 2022 11:21
Export footprint JSON from Apple photos.
@surmon-china
surmon-china / scroll-to-anywhere.js
Created March 8, 2017 17:41
js scrool function
"use strict"
let BezierEasing = require("bezier-easing")
let _ = {
$(selector) {
return document.querySelector(selector)
},
on(element, events, handler) {
if (!(events instanceof Array)) {
@surmon-china
surmon-china / index.js
Created February 25, 2017 19:05
vue中使用disqus
/**
* Vue-disqus
* @author Surmon.me
*/
const DisqusComponent = require('./disqus.vue')
const disqus = {
install: function(Vue) {
Vue.component('disqus-box', DisqusComponent)
@surmon-china
surmon-china / better-nodejs-require-paths.md
Created February 20, 2017 14:47 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

var Article = require('../../../models/article');

Those suck for maintenance and they're ugly.

Possible solutions

// Parameters obj-
let params: URLSearchParams = new URLSearchParams();
params.set('appid', StaticSettings.API_KEY);
params.set('cnt', days.toString());
//Http request-
return this.http.get(StaticSettings.BASE_URL, {
search: params
}).subscribe(
(response) => this.onGetForecastResult(response.json()),
[ngModel]="range" (ngModelChange)="saverange($event)"