Skip to content

Instantly share code, notes, and snippets.

View chuckgreenman's full-sized avatar

Chuck Greenman chuckgreenman

View GitHub Profile
@chuckgreenman
chuckgreenman / magento-permissions.sh
Created October 7, 2020 15:54
Programmatically set permissions for magento.
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;
find ./var -type d -exec chmod 777 {} \;
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chmod u+x bin/magento

Keybase proof

I hereby claim:

  • I am chuckgreenman on github.
  • I am chuckgreenman (https://keybase.io/chuckgreenman) on keybase.
  • I have a public key ASCuCmdpPg4Dna8w9V8qLilKnSvxBxaBFxXl1vMeVYgN5go

To claim this, I am signing this object:

@chuckgreenman
chuckgreenman / enumerate_fields.rb
Created April 5, 2019 12:17
Enumerate all fields in scholar works
fields = {
etd: ["title", "creator", "college", "department", "description", "advisor", "license", "committee_member", "degree", "date_created", "etd_publisher", "alternate_title", "genre", "subject", "geo_subject", "time_period", "language", "required_software", "note", "related_url", "existing_identifier", "visibility_during_embargo", "embargo_release_date", "visibility_after_embargo"],
article: ["title", "creator", "college", "department", "description", "license", "publisher", "date_created", "alternate_title", "journal_title", "issn", "subject", "geo_subject", "time_period", "language", "required_software", "note", "related_url", "existing_identifier", "admin_set_id", "new_user_permission_skel", "visibility_during_embargo", "embargo_release_date", "visibility_after_embargo"],
document: ["title", "creator", "college", "department", "description", "license", "publisher", "date_created", "alternate_title", "genre", "subject", "geo_subject", "time_period", "language", "required_software", "note", "rela
@chuckgreenman
chuckgreenman / server.go
Created September 25, 2018 21:49
Server implementation
package server
import (
"fmt"
"net"
"log"
"crypto/tls"
"encoding/binary"
)
@chuckgreenman
chuckgreenman / run_length_encoder.go
Created September 5, 2018 21:31
A simple run length encoder written in Go
package main
import (
"fmt"
"strconv"
)
func rleCompression(s string) string {
var consecuativeCharCount int
var lastCharacter rune
@chuckgreenman
chuckgreenman / main.go
Created August 3, 2018 22:12
A Naive Solution to Two Sums
package main
import "fmt"
func twoSums(nums []int, target int) []int {
for i, num_a := range nums {
for j, num_b := range nums {
if num_a + num_b == target && i != j {
return []int{i,j}
}
@chuckgreenman
chuckgreenman / knn_example.py
Created June 11, 2018 12:42
Get data from CSV file for KNN
import csv
with open("iris.csv") as file:
reader = csv.reader(file)
data = []
for record in reader:
data.append(record)
print(data)
curl -o iris.csv https://gist.githubusercoac0be92eab513706a599cf1511ce9e2/raw/0aa7077978d94e023c67ebc88666d1b6320feaa0/Iris%2520Data
@chuckgreenman
chuckgreenman / Iris Data
Created June 10, 2018 17:58
The Iris Data
sepal_length,sepal_width,petal_length,petal_width,species
5.1,3.5,1.4,0.2,setosa
4.9,3.0,1.4,0.2,setosa
4.7,3.2,1.3,0.2,setosa
4.6,3.1,1.5,0.2,setosa
5.0,3.6,1.4,0.2,setosa
5.4,3.9,1.7,0.4,setosa
4.6,3.4,1.4,0.3,setosa
5.0,3.4,1.5,0.2,setosa
4.4,2.9,1.4,0.2,setosa
@chuckgreenman
chuckgreenman / stub.go
Last active December 20, 2017 19:18
Stub of a go program demonstrating Cgo
pacakge main
//#include <stdio.h>
import "C"
import "fmt"