This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const observer = new MutationObserver(mutations => { | |
for(const mutation of mutations) { | |
for(const addedNode of mutation.addedNodes) { | |
if(addedNode.tagName === "VIDEO") { | |
const video = addedNode | |
video.addEventListener("timeupdate", () => { | |
const adSkipButton = document.querySelector(".ytp-ad-skip-button-slot button,.ytp-ad-overlay-close-button") | |
if(adSkipButton) { | |
adSkipButton.click() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import PropTypes from "prop-types"; | |
import TaskItem from "./TaskItem"; | |
import { randomStr } from "../utils/util" | |
class TaskItems extends Component { | |
static propTypes = { | |
taskListId: PropTypes.num, | |
taskItems: PropTypes.array, | |
userId: PropTypes.string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ffmpeg -ss 600 -i input.mp4 -vframes 1 -filter:v 'yadif,scale=420:270' output.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Opera 8.0+ | |
var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0; | |
// Firefox 1.0+ | |
var isFirefox = typeof InstallTrigger !== 'undefined'; | |
// Safari <= 9 "[object HTMLElementConstructor]" | |
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0; | |
// Internet Explorer 6-11 | |
var isIE = /*@cc_on!@*/false || !!document.documentMode; | |
// Edge 20+ | |
var isEdge = !isIE && !!window.StyleMedia; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
Plugin 'gmarik/Vundle.vim' | |
Plugin 'kien/ctrlp.vim' | |
Plugin 'scrooloose/nerdtree.git' | |
Plugin 'easymotion/vim-easymotion' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var React = require('react'); | |
var Example = React.createClass({ | |
// | |
propTypes: function() { | |
}, | |
displayName: function() { | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048 | |
openssl rsa -passin pass:x -in server.pass.key -out server.key | |
rm server.pass.key | |
openssl req -new -key server.key -out server.csr | |
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"net/http" | |
) | |
func main() { | |
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { | |
w.Header().Set("Content-Type", "applicaiton/zip") | |
w.Header().Set("Content-Disposition", "attachment; filename='file.html.zip'") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
_ "github.com/go-sql-driver/mysql" | |
"github.com/jmoiron/sqlx" | |
"log" | |
) | |
type User struct { | |
Id int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This awesome jQuery plugin will check the file size and against the selected upload file and | |
// determine if its allowable. The size limit will have to be in bytes. | |
// Parameters: | |
// evt_type - the javascript event, if non is needed, set to empty string | |
// limit - the size limit in bytes (default javascript size measurement) | |
$.fn.fileSizeCheck = function(evt_type, limit) { | |
var sizeLimit = limit; | |
if (evt_type == "") { |
NewerOlder