Skip to content

Instantly share code, notes, and snippets.

View iflamed's full-sized avatar

New Bing iflamed

View GitHub Profile
@dongyuwei
dongyuwei / dir2tree.js
Created March 30, 2012 07:31
dir to tree by nodejs 递归遍历目录,生成一个js树对象.
(function() {
var path = require('path'), fs = require('fs');
function walk(uri,filter,tree) {
var node = {
name : null,
children : [],
pNode : null,
};
@martincarlin87
martincarlin87 / deploy.php
Last active October 14, 2019 05:21
Deployer Laravel 5
<?php
namespace Deployer;
require 'recipe/laravel.php';
$repo_url = '';
$branch = 'master';
$server_url = '';
$user = '';
@v5tech
v5tech / ffmpeg.md
Last active January 16, 2024 09:19
ffmpeg视频合并、格式转换、截图

使用ffmpeg合并MP4文件

ffmpeg -i "Apache Sqoop Tutorial Part 1.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate1.ts
ffmpeg -i "Apache Sqoop Tutorial Part 2.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate2.ts
ffmpeg -i "Apache Sqoop Tutorial Part 3.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate3.ts
ffmpeg -i "Apache Sqoop Tutorial Part 4.mp4" -c copy -bsf:v h264_mp4toannexb -f mpegts intermediate4.ts
ffmpeg -i "concat:intermediate1.ts|intermediate2.ts|intermediate3.ts|intermediate4.ts" -c copy -bsf:a aac_adtstoasc "Apache Sqoop Tutorial.mp4"
@kyo-takano
kyo-takano / lexical_search_with_gzip.py
Last active March 11, 2024 03:39
Lexical Search with gzip (gzipによる語彙検索)
import gzip
def gzip_search(query: str, candidate_chunks: list[str], top_k: int=1):
"""
文字列ベースで類似したテキストチャンクを推定するアルゴリズム.
`query`, `chunk`, および`query + " " + chunk`をそれぞれgzipで圧縮し、編集距離のようなものをベースに評価する.
Parameters:
query (str): 検索クエリとして使用する文字列.
top_k (int, optional): 返される類似チャンクの上位k個を指定する (default: 1).
@adrianhajdin
adrianhajdin / alanStudio.js
Created August 4, 2020 09:56
Alan Studio Code Materials
intent('What does this app do?', 'What can I do here?',
reply('This is a news project.'));
const API_KEY = '7bdfb1b10aca41c6becea47611b7c35a';
let savedArticles = [];
// News by Source
intent('Give me the news from $(source* (.*))', (p) => {
let NEWS_API_URL = `https://newsapi.org/v2/top-headlines?apiKey=${API_KEY}`;
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@gokulkrishh
gokulkrishh / media-query.css
Last active April 18, 2024 18:20
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */