昨天,今天,明天,每天的每天,你是否都多懂得一点点...

星期三, 十月 31, 2018

闲逛游戏厅偶遇一小哥玩跳舞机,才知道, 原来跳舞机是这么玩的!All Combo! 【新西兰探险记】

Tags: 跳舞机, 劲乐团,游戏厅,新西兰
今天中午吃完饭街上闲逛到了游戏厅, 看到一小哥玩跳舞机,才知道自己的水平真是弱爆了!!


-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 同时我也会分享一些编程的教程, 如编写Telegram机器人, 建站等。 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-

星期一, 十月 29, 2018

[Youtube] 谁说索尼 SONY A6300 微单相机没有翻转屏? 不仅有翻转屏,而且是超大翻转屏,不只有一个翻转屏,还可以来两个

Tags: 1080p, 4k, Sony, a6000, a6300 in 2018 a6300, a6500 vs a6300, a6500, alfa6300, alpha 6300, alpha6300, android, app, audio, camera, canon, cine 4, color finale, color grading, connect, control, download, fi, focus peaking, how, iphone, is a6300 good, leica tl, memories, mirrorless camera, mobile, peaking, phone, play memories, play, playmemories mobile, playmemories, professional, remote, review, slog 3, smart, sony a6000, sony a6300, sony, to, used a6300, wi fi, wi, wi-fi, wifi, your, 产品, 体验, 单反, 单电, 发布, 器材 娱乐, 开箱 微单, 数码, 新品, 消费, 热点, 电子, 相机 科技, 索尼, 观点, 设备, 评测, 资讯


当初我买索尼A6300这款微单相机的时候就知道翻转屏是他的一个弱项,但是一始终相信这个问题可以解决,瞧,我不仅解决了翻转屏的问题,还解决得如此完美。如果我大多数时候是在室内录视频,所以重量和臂力暂时还不是我需要担心的问题。


-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-

一键建站 | 一分钟拥有自己的网站 | Windows, Linux, VPS 都可以用 | 超快速建站| Wordpress

Tags: 建站,一键建站, wordpress, docker

本视频介绍一个一分钟快速一键建站的方法, 这个方法可以在Windows, Linux , VPS, Mac os 等各个平台通用。 本视频还会介绍网站建好后如何发布博客, 添加菜单, 添加主页等基本wordpress 的设置。


一键建站命令:

docker run --name test-mysql -e MYSQL_ROOT_PASSWORD=mypassword -d mysql:5.7.22
docker run --name test-wordpress --link test-mysql:mysql -p 8080:80 -d wordpress
-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-

星期三, 十月 24, 2018

[Youtube] Youtube大BUG | 订阅消失之迷 | 给Youtube官方的一封信


最近Youtube掉订阅的BUG困扰了很多Youtuber, 甚至有些Youtuber 都不在发更新了。 这个BUG非常的严重,我今天响应中文Youtuber 的号召,在这里发出自己的声音。 希望更多的Youtuber 站出来发声, 让这个问题得到Youtube 官方的重视,和及时的解决。

如果你曾订阅以下频道,却发现不知不觉中被退订了,你可以点击以下链接重新订阅。



星期日, 十月 21, 2018

Make VScode Auto completion and definition jump work on Google Apps Script Clasp

If you have ever developed Google Apps script with its default online IDE, you may have noticed that auto completion is not there for easy access of functions.

Google provide a CLI tool "Clasp" which can pull Google Apps Scritp .gs files onto your local converted to .js files.

Then you can version control these files and edit them in your favorite editor. Then you can push your edited files back to Google.

I use Visual Studio code as my Google Apps script IDE. By default, the auto completion only works within the same files. If you defined a function or variable in another file, the auto completion will not work. And you cannot jump to function definition by pressing F12.

To make the auto completion works, some configurations are needed.

The following is what I do to enable auto completion for Google Apps Script in VScode.

1. Run npm init to convert it to a nodejs project. A package.json file will be created.
2. Install google apps script type npm install --save @types/google-apps-script
3. Install typescript type npm install --save @types/google-apps-script
4. Create a jsconfig.json with following content:

[json]
    "compilerOptions": {
        "checkJs": true
      }
}  

[/json]

5. Create a tsconfig.json file with following content:

[json]
    "compilerOptions": {
        "allowJs": true,
        "checkJs": true,
        "types": ["google-apps-script"]
      }
}  
[/json]

6. Create a .claspignore file contains following content:

[code]
jsconfig.json
tsconfig.json
.gitignore
node_modules/**
[/code]

Once you have done the above steps, you will find the auto completion works magically.




星期五, 十月 19, 2018

[Youtube]Telegram Bot 判断群消息的来源和处理有人入群, 有人被踢等[第六集]

Tags:  
Telegram, 机器人,
 聊天机器人,机器人编程,机器人代码, Telegram代码,Telegram Bot, Telegram编程  

本视频是Telegram Bot 机器人编程系列的第六集。 本集介绍群消息的格式, 原来机器人收到的消息是长这个样子呀。 还有如何处理群通知,比如说有人入群,有人被移出群, 有消息被置顶等


相关的代码请
翻到下面

下期预告:
Telegram Bot 连接Mongo DB 数据库, 超酷超好用的JSON数据库, 不需要学SQL啦[第七集]  


-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-

[javascript]
function doGet(e){
  return HtmlService.createHtmlOutput("Hello World!! No, this link should be hidden!!!");
  
 //  return HtmlService.createHtmlOutputFromFile('Index');
}


function doPost(e){
  var body = JSON.parse(e.postData.contents);
  

  var payload = preparePayload(body);
  var data = {    
    "method": "post",
    "contentType": 'application/json',
    "payload": JSON.stringify(payload),
  }
  
}

function getName(user) {
  var name = user.first_name;
  if (user.last_name) {
    name += " " + user.last_name;
  }

  return name;
}

function escapeMarkDown(toEscapeMsg) {
  var escapedMsg = toEscapeMsg
  .replace(/_/g, "\\_")
  .replace(/\*/g, "\\*")
  .replace(/\[/g, "\\[")
  .replace(/`/g, "\\`");
    return escapedMsg;

}


function getMentionName(user) {
  var username = user.username;
  var mentionName = "";

  var name = getName(user);
  if (!name) {
    name = "神秘人";
  }

  // if (!username) {
    mentionName = getMarkDownUserUrl(escapeMarkDown(name), user.id);
  // } else {
  //   mentionName = "[" + escapeMarkDown(name) + "](@" + escapeMarkDown(username) + ")";
  // }

  return mentionName;
}

function getMarkDownUserUrl(userName, userId) {
  return "[" + userName + "](tg://user?id=" + userId + ")";
}


function preparePayload(body){
  var payload;
  
  if (body.message.new_chat_member) {
     payload = {
        "method": "sendMessage",
        "chat_id": body.message.chat.id,
        "text": "你好, 欢迎加入本群",
        "parse_mode": "Markdown",
        "disable_web_page_preview": true,
      } 
      
      payload.text = "你好!" + getMentionName(body.message.new_chat_member) + ", 欢迎加入本群";
      return payload;
  }
  
  if (body.message.left_chat_member) {
     payload = {
        "method": "sendMessage",
        "chat_id": body.message.chat.id,
        "text": "你好, 欢迎加入本群",
        "parse_mode": "Markdown",
        "disable_web_page_preview": true,
      } 
      
      payload.text = getMentionName(body.message.left_chat_member) + "君, 一路走好!";
      return payload;
  }
  
   if (body.message.pinned_message) {
    payload = {
        "method": "sendMessage",
        "chat_id": body.message.chat.id,
        "text": "你好, 欢迎加入本群",
        "parse_mode": "Markdown",
        "disable_web_page_preview": true,
      } 
    var whoPinned = getName(body.message.from);
    var whoOwned = getName(body.message.pinned_message.from);

    payload.text = whoPinned + "置顶了消息:\n\n" + body.message.pinned_message.text
      + "\n\n"
      + "本BOT代表" + whoOwned + "感谢您"
      ;
    return payload;
  }


  body.message.text = body.message.text.toLowerCase();
  body.message.text = body.message.text.replace(/@temptestbot2/g, '');
  
  var paras = body.message.text.trim().split(" ");
  // remove empty strings
  paras = paras.filter(function(para){
    if (para){
      return true;
    }
  });
  
  
  
  if (body.message.text){
  
      payload = {
        "method": "sendMessage",
        "chat_id": body.message.chat.id,
        "text": "你好, 欢迎使用本机器人, 本机器人现在只认识颜色。",
        "parse_mode": "Markdown",
        "disable_web_page_preview": true,
      } 
      
      if(body.message.text.indexOf("/help") === 0){      
         payload.text = "你好, 欢迎使用本机器人, 本机器人现在只认识颜色。";
         return payload;
      }
      
      if(body.message.text.indexOf("/colors") === 0){   
         payload.text = "红\n黄\n蓝";        
         return payload;
      }
      
      if(body.message.text.indexOf("/list") === 0){ 
         if (paras[1]){
           switch (paras[1].toLowerCase()){
             case "people":  
               if (paras[2]){
                 if ("JS神技能".toLowerCase().indexOf(paras[2]) >= 0){
                   payload.text = "JS神技能 - https://www.youtube.com/channel/UC6tPP3jOTKgjqfDgqMsaG4g";
                 }
                 if ("悟空的日常".toLowerCase().indexOf(paras[2]) >= 0){
                   payload.text = "悟空的日常 - https://www.youtube.com/channel/UCii04BCvYIdQvshrdNDAcww";
                 }
                 if ("YuFeng Deng".toLowerCase().indexOf(paras[2]) >= 0){
                   payload.text = "YuFeng Deng - https://www.youtube.com/channel/UCG6xoef2xU86hnrCsS5m5Cw";
                 }
               } else {                 
                 payload.text = "JS神技能\n"
                   + "悟空的日常\n"
                   + "YuFeng Deng\n";        
                   return payload;
                }
               break;
             default:  
               payload.text = "红\n黄\n蓝";            
             break;
           }
                
           return payload;
         } else {         
           payload.text = "*JS神技能*\n"
             + "[悟空的日常](https://www.youtube.com/channel/UCii04BCvYIdQvshrdNDAcww)\n"
             + "[*YuFeng Deng*](https://www.youtube.com/channel/UCG6xoef2xU86hnrCsS5m5Cw)\n"
             + "_YuFeng Deng_\n"
             + "`01|" + "UCii04BCvYIdQvshrdNDAcww" + " | `\n"
             + "`02|" + "UCG6xoef2xU86hnrCsS5m5Cw" + " | `\n"
             + "```javascript\n"
             + 'payload = {\n'
             + '    "method": "sendMessage",\n'
             + '    "chat_id": body.message.chat.id,\n'
             + '    "text": body.message.text,\n'
             + '}'
             + "```"
             ;
                       
            var inlineKeyboardMarkup = {};
            inlineKeyboardMarkup.inline_keyboard = [];
            var keyboardRow = [];
            var keyboardButton1 = {
                text: "按钮1",
                url: "https://www.google.com"
            };
            
            var keyboardButton2 = {
                text: "按钮2",
                url: "https://www.google.com"
            };
            
            var keyboardRow2 = [];
            var keyboardButton3 = {
                text: "按钮3",
                url: "https://www.google.com"
            };
            
            var keyboardButton4 = {
                text: "按钮4",
                url: "https://www.google.com"
            };

            keyboardRow.push(keyboardButton1);
            keyboardRow.push(keyboardButton2);
            
            keyboardRow2.push(keyboardButton3);
            keyboardRow2.push(keyboardButton4);
            inlineKeyboardMarkup.inline_keyboard.push(keyboardRow);
            inlineKeyboardMarkup.inline_keyboard.push(keyboardRow2);
            payload.reply_markup = inlineKeyboardMarkup;

       
           return payload;
         }
      }
      

  
      payload = {
          "method": "sendMessage",
          "chat_id": body.message.chat.id,
          "text": body.message.text,
      } 
  }
  else if (body.message.sticker){
    payload = {
      "method": "sendSticker",
      "chat_id": body.message.chat.id,
      "sticker": body.message.sticker.file_id
    }
   }
  else if (body.message.photo){
    array = body.message.photo;
    text = array[1];
    payload = {
      "method": "sendPhoto",
      "chat_id": body.message.chat.id,
      "photo": text.file_id
    }
   }
    else {
    payload = {
      "method": "sendMessage",
      "chat_id": body.message.chat.id,
      "text": "Try other stuff"
    }
   }
  return payload
}
[/javascript]

星期四, 十月 18, 2018

Telegram 机器人JSON消息例子

有人加群 

[javascript]
{
    "update_id": 23503327,
    "message": {
        "message_id": 585,
        "from": {
            "id": 539065210,
            "is_bot": false,
            "first_name": "Yufeng Deng",
            "last_name": "峰哥",
            "username": "fennng",
            "language_code": "en-US"
        },
        "chat": {
            "id": -243723653,
            "title": "机器人测试",
            "type": "group",
            "all_members_are_administrators": true
        },
        "date": 1536765953,
        "new_chat_participant": {
            "id": 646807833,
            "is_bot": true,
            "first_name": "YoutubeChannels",
            "username": "YoutubeChannelsBot"
        },
        "new_chat_member": {
            "id": 646807833,
            "is_bot": true,
            "first_name": "YoutubeChannels",
            "username": "YoutubeChannelsBot"
        },
        "new_chat_members": [
            {
                "id": 646807833,
                "is_bot": true,
                "first_name": "YoutubeChannels",
                "username": "YoutubeChannelsBot"
            }
        ]
    }
}
[/javascript]

有人退群
[javascript]  
{
    "update_id": 23503328,
    "message": {
        "message_id": 587,
        "from": {
            "id": 539065210,
            "is_bot": false,
            "first_name": "Yufeng Deng",
            "last_name": "峰哥",
            "username": "fennng",
            "language_code": "en-US"
        },
        "chat": {
            "id": -243723653,
            "title": "机器人测试",
            "type": "group",
            "all_members_are_administrators": true
        },
        "date": 1536765977,
        "left_chat_participant": {
            "id": 492930333,
            "is_bot": false,
            "first_name": "Bo Jun"
        },
        "left_chat_member": {
            "id": 492930333,
            "is_bot": false,
            "first_name": "Bo Jun"
        }
    }
}
[/javascript]  

有消息被置顶
[javascript]  
{
    "update_id": 23503804,
    "message": {
        "message_id": 1242,
        "from": {
            "id": 539065210,
            "is_bot": false,
            "first_name": "Yufeng Deng",
            "last_name": "峰哥",
            "username": "fennng",
            "language_code": "en-nz"
        },
        "chat": {
            "id": -1001220016062,
            "title": "峰享电报群",
            "username": "fengsharegroup",
            "type": "supergroup"
        },
        "date": 1536889877,
        "pinned_message": {
            "message_id": 1088,
            "from": {
                "id": 539065210,
                "is_bot": false,
                "first_name": "Yufeng Deng",
                "last_name": "峰哥",
                "username": "fennng",
                "language_code": "en-nz"
            },
            "chat": {
                "id": -1001220016062,
                "title": "峰享电报群",
                "username": "fengsharegroup",
                "type": "supergroup"
            },
            "date": 1536456673,
            "forward_from_chat": {
                "id": -1001189603696,
                "title": "峰享频道",
                "username": "fengshare",
                "type": "channel"
            },
            "forward_from_message_id": 21,
            "forward_date": 1536456665,
            "text": "https://youtu.be/Q8IlXt29A4k",
            "entities": [
                {
                    "offset": 0,
                    "length": 28,
                    "type": "url"
                }
            ]
        }
    }
}
[/javascript]  

有人发图片

[javascript]  
{
    "update_id": 23503431,
    "message": {
        "message_id": 700,
        "from": {
            "id": 539065210,
            "is_bot": false,
            "first_name": "Yufeng Deng",
            "last_name": "峰哥",
            "username": "fennng",
            "language_code": "en-US"
        },
        "chat": {
            "id": 539065210,
            "first_name": "Yufeng Deng",
            "last_name": "峰哥",
            "username": "fennng",
            "type": "private"
        },
        "date": 1536828355,
        "photo": [
            {
                "file_id": "AgADAQAD6acxG-uM2ERbhuvOVZq5lcN1DDAABNaIzKcBfFWUS2oCAAEC",
                "file_size": 606,
                "width": 90,
                "height": 71
            },
            {
                "file_id": "AgADAQAD6acxG-uM2ERbhuvOVZq5lcN1DDAABNEnj3XxiEDzSmoCAAEC",
                "file_size": 4147,
                "width": 320,
                "height": 252
            },
            {
                "file_id": "AgADAQAD6acxG-uM2ERbhuvOVZq5lcN1DDAABA5UjKohgkCWSWoCAAEC",
                "file_size": 5980,
                "width": 421,
                "height": 332
            }
        ],
        "caption": "draw image 121211221",
        "caption_entities": [
            {
                "offset": 11,
                "length": 9,
                "type": "phone_number"
            }
        ]
    }
}
[/javascript]  

有人发命令
[javascript]  
{
    "update_id": 23503354,
    "message": {
        "message_id": 592,
        "from": {
            "id": 539065210,
            "is_bot": false,
            "first_name": "Yufeng Deng",
            "last_name": "峰哥",
            "username": "fennng",
            "language_code": "en-US"
        },
        "chat": {
            "id": -243723653,
            "title": "机器人测试",
            "type": "group",
            "all_members_are_administrators": false
        },
        "date": 1536787353,
        "text": "/update@YoutubeChannelsBot",
        "entities": [
            {
                "offset": 0,
                "length": 26,
                "type": "bot_command"
            }
        ]
    }
}
[/javascript]  




星期三, 十月 17, 2018

Angular 2 - cannot access property in this object when handler an error in the different class

One of my colleagues define a error handler in a singleton service. This service is injected into other class for handling errors. 

For example, the following code is use to send a post request. And the error will be handled by this.helperService.handleError method.


return this.http
.post(
environment.user2ServiceEndPoint + '/batch',
JSON.stringify(newUser2s.toJS()),
this.options
)
.share()
.catch(this.helperService.handleError);
}


The problem of this code is that inside the handleError method, it cannot access any property in the helperService object. 

Because in this case, the this.helperService.handleError
is passed as a function delegate to the current class. The this object will be referred to the current object rather than the helperService Object. 

The correct way is as following. You have to define an anonymous function. And in this function, you call the handlerError method using the helperService object. In this case, the handlerError method is called by helperService, and the this object is refer to helpService object.

return this.http
.post(
environment.user2ServiceEndPoint + '/batch',
JSON.stringify(newUser2s.toJS()),
this.options
)
.share()
.catch(e => this.helperService.handleError(e));





星期日, 十月 14, 2018

The Linux timeout command

Sometimes, you may want to run some network command which may take long time to run. If you want to cancel the command which runs too long, you can use the timeout command. 

I use the MPV command to collection some live stream info. The command may stuck when testing a bad url. The timeout command comes handy here. 

timeout -k 60 60 mpv --no-video --length=0 --network-timeout=10 "http://edge.music-choice-vc-chaina1.top.comcast.net/VideoChannels/VC-MC128/playlist.m3u8" | grep "Playing\|Video" 


星期五, 十月 12, 2018

Surface book 2 终级笔记本, 第一印像,好不好用,值不值得买

Tags: Surface Book 2, 终级笔记本, 评测, 使用心得, 经验分享, 好不好, 双显卡

用了surface book 2 这款被称为终级笔记本的电脑已经两个多月了, 我还是非常喜欢它的, 今天就来跟大家分享一下我的使用经验。 这个视频并不是一个完整的评测,只是从个人和工作的使用角度来看的。

-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-


--
Feng

星期一, 十月 08, 2018

[youtube] 海外党如何看国产影视节目,绕过版权限制,无需APP,电视剧,电影,体育,少儿,纪录片,应有尽有

Tags: 海外党,电视剧,电影, 纪录片, 在线 ,体育直播 ,少儿节目

今天介绍的这个方法适合喜欢看国产电视剧,电影的小伙伴们。 当然,如果你喜欢体育,动漫,纪录片等也是没有问题的。海外党的福音呀。 

相关链接请到我的网站 

-~-~~-~~~-~~-~-

本频道旨在分享生活中各种小技巧, 如用小米盒子看国内视频, 如何使用KODI看电影等等. 点击进入我的频道: goo.gl/5tyxcf

🔷 订阅我的频道: goo.gl/KuF3bY
🔷 telegram电报群: t.me/fengsharegroup
🔷 我的博客: www.dengnz.com/blog
🔷 Facebook: www.facebook.com/fengnz

觉得我的视频对你帮助很大的话, 请我喝杯咖啡吧
微信赞赏码: goo.gl/uKoE8w
-~-~~-~~~-~~-~-

其它博客地址

此博客的同步博客地址: http://fengnz.wordpress.com
这里进入我的MSN SPACE.