Skip to content

Instantly share code, notes, and snippets.


Surmon surmon-china

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

Better local require() paths for Node.js


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

View ng2 http get params.js
// 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
(response) => this.onGetForecastResult(response.json()),
View ng2ngModelChange.js
[ngModel]="range" (ngModelChange)="saverange($event)"