Skip to content

Instantly share code, notes, and snippets.

View fictorial's full-sized avatar

Brian Hammond fictorial

View GitHub Profile
#!/usr/bin/env python
import math
import sys
from moviepy.editor import AudioClip, VideoFileClip, concatenate_videoclips
# Get average RGB of part of a frame. Frame is H * W * 3 (rgb)
# Assumes x1 < x2, y1 < y2
@TutorialDoctor
TutorialDoctor / summarizer.py
Created January 1, 2020 19:04
Summarize web pages given a URL
import bs4 as bs
import urllib.request
import re
import nltk
#Install beautifulsoup
#Article this is from:
#https://stackabuse.com/text-summarization-with-nltk-in-python/
#NLTK help:
#https://stackoverflow.com/questions/4867197/failed-loading-english-pickle-with-nltk-data-load
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 5, 2024 20:59
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@mnutt
mnutt / example.md
Last active December 27, 2023 14:10
TreeStyleTab sidebar tabs only

Example:

firefox

@ilessing
ilessing / Pandoc Markdown to PDF.md
Last active April 26, 2024 22:15
getting pandoc to generate PDF from Markdown on MacOS

Using Pandoc to generate PDFs from Markdown

on a Mac running macOS 10.13.4

To install the needed components you can use Homebrew

Two Components are needed:

100 Stupid Questions for React Native

What is React Native? Is it same as React?

React Native lets you build mobile apps using only JavaScript. It uses the same design as React, letting you compose a rich mobile UI from declarative components.

https://facebook.github.io/react-native/

Is React Native easy to learn?

It depends on what project you are going to build. As for front-end developer, you nearly need to learn nothing, only a new way to write javascript (Redux, JSX).

Do I must learn Redux?

#!/usr/bin/env bash
set -e
main() {
previous_file="$1"
file_to_edit=`select_file $previous_file`
if [ -n "$file_to_edit" ] ; then
"$EDITOR" "$file_to_edit"
main "$file_to_edit"
@danielkcz
danielkcz / App.js
Created September 6, 2017 12:59
Update Expo app
import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Util } from 'expo'
export default class App extends React.Component {
state = {
updated: false,
}
componentWillMount() {
Util.addNewVersionListenerExperimental(() => {
@chinmaygarde
chinmaygarde / FlutterEmbedderGLFW.cc
Last active November 23, 2023 16:26
Flutter Embedder API Example (GLFW with OpenGL)
#include <assert.h>
#include <chrono>
#include <embedder.h>
#include <glfw3.h>
#include <iostream>
static_assert(FLUTTER_ENGINE_VERSION == 1, "");
static const size_t kInitialWindowWidth = 800;
@bithavoc
bithavoc / eureka_swift_3:composable_search_row.swift
Last active April 23, 2024 13:32
Eureka Swift 3 Composable Search Row
open class _ComposableSearchablePushRow<T: Equatable, Cell: CellType> : TableSelectorRow<Cell, ComposableSearchableViewController<T>> where Cell: BaseCell, Cell: TypedCellType, Cell.Value == ComposableSearchableItem<T>, T: SearchableItem, T: CustomStringConvertible {
public required init(tag: String?) {
super.init(tag: tag)
onCreateControllerCallback = { [weak self] _ in
let controller = ComposableSearchableViewController<T>()
controller.searchPlaceholder = self?.searchPlaceholder
return controller
}