Skip to content

Instantly share code, notes, and snippets.

Jesse Cooke jc00ke

Block or report user

Report or block jc00ke

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jc00ke
jc00ke / archdual.sh
Created Jun 14, 2019 — forked from altercation/archdual.sh
arch-dual drive config
View archdual.sh
#!/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 Jun 14, 2019 — forked from altercation/bulletproof_arch.txt
Bulletproof Arch - Minimal Clean Install
View bulletproof_arch.txt
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
View table_live.ex
# 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>
View route53.tf
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 Jan 18, 2019
Console log JSON in Elm with ports
View Main.elm
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 Dec 20, 2018 — forked from tanaikech/submit.md
Upload Files to Google Drive using Javascript
View submit.md

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.

View default_arg_method_call.rb
def bar
:bar
end
def foo(a, b=bar)
puts [a, b].inspect
end
foo("hi")
# => ["hi", :bar]
@jc00ke
jc00ke / authenticated.rb
Last active Aug 14, 2018
Using Module prepend with an argument
View authenticated.rb
# spec/support/authenticated.rb
class Authenticated < Module
def initialize(current_user:)
super() do
define_method :current_user do
current_user
end
end
end
end
View omnibus-aptible-toolbelt.txt
[CLI] I | 2018-06-29T15:49:44-07:00 | Using config from 'omnibus.rb'
[Software: config_guess] W | 2018-06-29T15:49:44-07:00 | Version master for software config_guess was not parseable. Comparison methods such as #satisfies? will not be a
vailable for this version.
Building aptible-toolbelt ...
[Software: preparation] I | 2018-06-29T15:49:44-07:00 | Resolving manifest entry for preparation
[NullFetcher: preparation] I | 2018-06-29T15:49:44-07:00 | Fetching `preparation' (nothing to fetch)
[Software: config_guess] I | 2018-06-29T15:49:44-07:00 | Resolving manifest entry for config_guess
[Software: config_guess] W | 2018-06-29T15:49:44-07:00 | Version master for software config_guess was not parseable. Comparison methods such as #satisfies? will not be a
vailable for this version.
[Software: config_guess] W | 2018-06-29T15:49:44-07:00 | Version master for software config_guess was not parseable. Comparison methods such as #satisfies? will not be a
@jc00ke
jc00ke / install-2.3.1.md
Last active Jun 28, 2019
Install Ruby 2.3.1 on Manjaro Linux
View install-2.3.1.md
$> sudo pacman -S gcc5 openssl-1.0
$> CC=gcc-5 CXX=g++-5 PKG_CONFIG_PATH=/usr/lib/openssl-1.0/pkgconfig/:/usr/lib/pkgconfig/RUBY_CONFIGURE_OPTS=--with-openssl-dir=/usr
/lib/openssl-1.0/ asdf install ruby 2.3.1

Detailed steps

You can’t perform that action at this time.