This file contains hidden or 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
| from django.contrib import admin | |
| from django.contrib.flatpages.models import FlatPage | |
| # Note: we are renaming the original Admin and Form as we import them! | |
| from django.contrib.flatpages.admin import FlatPageAdmin as FlatPageAdminOld | |
| from django.contrib.flatpages.admin import FlatpageForm as FlatpageFormOld | |
| from django import forms | |
| from ckeditor.widgets import CKEditorWidget |
This file contains hidden or 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 | |
| for filename in *.vtt; do | |
| fname="${filename%.*}" | |
| ffmpeg -i "$filename" "$fname.srt" | |
| done |
This file contains hidden or 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 canvasWidth = 1200; | |
| var canvasHeight = 1024; | |
| function setup() { | |
| createCanvas(canvasWidth, canvasHeight); | |
| } | |
| function draw() { | |
| stroke("#DCA6A6"); | |
| strokeWeight(0.1); |
This file contains hidden or 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
| function isPrime(value) { | |
| // create cache | |
| if (!isPrime.answers) { | |
| isPrime.answers = {}; | |
| } | |
| // check was value cached | |
| if (isPrime.answers[value] !== undefined) { | |
| return isPrime.answers[value]; | |
| } |
This file contains hidden or 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
| let store = { | |
| nextId: 1, | |
| cache: {}, | |
| add(fn) { | |
| if(!fn.id) { | |
| fn.id = this.nextId++; | |
| this.cache[fn.id] = fn; | |
| } | |
| return false; | |
| }, |
This file contains hidden or 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
| html, | |
| body { | |
| margin: 0; | |
| padding: 0; | |
| } | |
| body { | |
| width: 280px; | |
| min-height: 250px; | |
| padding-top: 50px; |
This file contains hidden or 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
| function *range(start, end, step=1) { | |
| let i = start; | |
| while ( i < end ) { | |
| yield i; | |
| i += step; | |
| } | |
| } | |
| [...range(0,5)].map(x => x*2); |
This file contains hidden or 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 Fib = { | |
| [Symbol.iterator]() { | |
| var n1 = 1, n2 = 1; | |
| return { | |
| // make the iterator an iterable | |
| [Symbol.iterator]() { return this; }, | |
| next() { | |
| var current = n2; |
This file contains hidden or 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 sys | |
| import os | |
| import re | |
| from shellpython.helpers import Dir | |
| ''' | |
| Compile *.md files to single or multiple pdf files | |
| Requirments: | |
| Python 3 |

