Skip to content

Instantly share code, notes, and snippets.

@jc00ke
jc00ke / gist:06fba53f3c8571c7bcbeb5de0e59be77
Created March 14, 2020 19:50
Convert MOV files to other formats
> ffmpeg -i proj03.mov -codec:v libtheora -qscale:v 7 -codec:a libvorbis -qscale:a 5 proj03.ogg
> ffmpeg -i proj03.mov -c:v libvpx -crf 10 -b:v 1M -c:a libvorbis proj03.webm
> ffmpeg -i proj03.mov -vcodec h264 -acodec mp2 proj03.mp4
#!/bin/bash
# Recommended steps:
#
# bootstrap before entering chroot
# copy this script into INSTALL_DIR
# rootinit after entering chroot
# x (if installing graphics)
# pkgs
# xpkgs (if installing graphics)
@jc00ke
jc00ke / install-vim8.txt
Last active January 23, 2020 19:41 — forked from opchaves/install-vim8.txt
Install Vim 8 with Python, Python 3, Ruby and Lua support on Regolith/Ubuntu 19.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
cd ~
@jc00ke
jc00ke / .projections.json
Created November 18, 2019 18:34 — forked from germsvel/.projections.json
Elixir/Phoenix basic projections
{
"lib/**/views/*_view.ex": {
"type": "view",
"alternate": "test/{dirname}/views/{basename}_view_test.exs",
"template": [
"defmodule {dirname|camelcase|capitalize}.{basename|camelcase|capitalize}View do",
" use {dirname|camelcase|capitalize}, :view",
"end"
]
},
@jc00ke
jc00ke / archdual.sh
Created June 14, 2019 16:39 — forked from altercation/archdual.sh
arch-dual drive config
#!/bin/sh
#----------------------------------------------------------------------
# Arch Linux Installation Script
#
# This installs, with no intervention (other than initial edit to change
# RAID array drive values), Arch Linux on an encrypted btrfs raid1 array.
#----------------------------------------------------------------------
set -eu
@jc00ke
jc00ke / bulletproof_arch.txt
Created June 14, 2019 16:39 — forked from altercation/bulletproof_arch.txt
Bulletproof Arch - Minimal Clean Install
These are working notes on the installation of Arch Linux. I've just completed this install on a notebook (Lenovo P50)
but the setup should work for most laptop/desktop configurations.
Some assumptions/notes:
1. This isn't a dual boot configuration. I can see some of the appeal and still work in Adobe from time to time, but given
the increasing complexity of EFI and the way Windows/MS manhandles the EFI partition during upgrades, I really would
recommend steering clear of dual boot. Just my two cents here.
2. We're encrypting with LUKS. I've used so-called "self encrypting drives" as well (and linux has multiple ways of dealing
# from https://github.com/joerichsen/phoenix_live_view_example/blob/be9315feb30f377fb144b1b03b2f93f792bfbfa7/lib/demo_web/live/table_live.ex
defmodule DemoWeb.TableLive do
use Phoenix.LiveView
def render(assigns) do
~L"""
<form phx-change="search"><input type="text" name="query" value="<%= @query %>" placeholder="Search..." /></form>
<table>
<thead>
resource "aws_route53_delegation_set" "main" {
reference_name = "main"
}
resource "aws_route53_zone" "relativepath-io" {
name = "relativepath.io"
}
resource "aws_route53_record" "staging" {
zone_id = "${aws_route53_zone.relativepath-io.zone_id}"
@jc00ke
jc00ke / Main.elm
Created January 18, 2019 20:25
Console log JSON in Elm with ports
port module Main exposing (main)
import Browser
import Html exposing (Html, button, div, text)
import Html.Events exposing (onClick)
import Json.Encode as E exposing (Value, int, object, string)
type alias Model =
{ count : Int
@jc00ke
jc00ke / submit.md
Created December 20, 2018 17:46 — forked from tanaikech/submit.md
Upload Files to Google Drive using Javascript

Upload Files to Google Drive using Javascript

This is a sample script for uploading files to Google Drive using Javascript. The files are uploaded by Drive API v3. gapi.client.drive.files.create() can create an empty file on Google Drive. But it cannot directly upload files including contents. I think that this might not be able to upload files and metadata with the multipart/related, although this might be resolved by the future update. So now, as one of workarounds, I use using XMLHttpRequest.

  • This sample uses gapi.
    • Before you use this, please enable Drive API at API console and carry out the installation of gapi.
  • When this script is run, a text file including "sample text" is created to Google Drive.
  • When you use this script, please set fileContent and metadata.

In this sample script, a text file including contents is created under a folder.