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 os | |
import time | |
import google_auth_oauthlib.flow | |
import googleapiclient.discovery | |
import googleapiclient.errors | |
scopes = ["https://www.googleapis.com/auth/youtube.force-ssl"] | |
def main(): |
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
# run as | |
# python generate_thumbnails_from_video.py path/to/directory | |
import os | |
import sys | |
# using moviepy | |
from moviepy.editor import * | |
from PIL import Image |
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 from "react"; | |
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles'; | |
import Paper from '@material-ui/core/Paper'; | |
import Grid from '@material-ui/core/Grid'; | |
import Box from '@material-ui/core/Box'; | |
import TextField from '@material-ui/core/TextField'; | |
import Typography from '@material-ui/core/Typography'; | |
import { Button } from '@material-ui/core'; | |
import { useForm } from 'react-hook-form'; | |
import * as yup from 'yup'; |
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
class ActorFilterEntry<Widget> { | |
const ActorFilterEntry(this.id, this.name); | |
final String name; | |
final int id; | |
} | |
class InterestsFilterPage extends State<InterestPage> { | |
... | |
List<Widget> actorWidgets(interest) { |
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
check process freeradius with pidfile /var/run/freeradius/freeradius.pid | |
start program = "/etc/init.d/freeradius start" | |
stop program = "/etc/init.d/freeradius stop" | |
if failed host 127.0.0.1 port 1812 type udp protocol radius secret testing123 then alert | |
if failed host 127.0.0.1 port 1812 type udp protocol radius secret testing123 then alert |
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 gulp = require('gulp'); | |
var concat = require('gulp-concat'); | |
var uglify = require('gulp-uglify'); | |
var rename = require('gulp-rename'); | |
var del = require('del'); // rm -rf | |
var browser = require('browser-sync').create(); | |
var port = process.env.SERVER_PORT || 3000; | |
gulp.task('clean', 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
// first day of the month | |
var firstDayThisMonth = moment(firstDayThisMonth).startOf('month').toDate(); | |
Go back and forth using the subtract() and add() with the endOf() and startOf(): | |
// last day of previous month | |
var yesterMonthLastDay = moment(yesterMonthLastDay).subtract(1,'months').endOf('month').toDate(); |
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
// Register listeners | |
window.addEventListener("offline", function(){ | |
$('#globalDiv').hide(); | |
$("#message").html('WARNING: Internet connection has been lost.').show(); | |
}); | |
window.addEventListener("online", function(){ | |
$("#message").empty().hide(); | |
$('#globalDiv').show(); | |
}); |
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
<script> | |
(function() { | |
var form = document.getElementById('form_837299'); | |
form.addEventListener('submit', function(event) { | |
// Prevent normal form submit | |
event.preventDefault(); | |
}); |
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/bash | |
# backup using https://github.com/deajan/osync | |
# Usage: | |
# ./backup-script nameOfFolder | |
# e.g | |
# ~$ ./backup-script Folder SecondFolder | |
echo "Starting backup" | |
for i |
NewerOlder