Skip to content

Instantly share code, notes, and snippets.

View mat-0's full-sized avatar
:octocat:

thechelsuk mat-0

:octocat:
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mat-0 on github.
  • I am thechelsuk (https://keybase.io/thechelsuk) on keybase.
  • I have a public key ASCwyTiriQCRcGS2JD99Kv4tQZQqQhs-006k-cP7SgFGKAo

To claim this, I am signing this object:

@mat-0
mat-0 / jekyll-menu-from-collection.html
Created June 16, 2022 20:04
Generate a menu list from a collection held in the _config.yml
<ul class="list list--nav">
{% for item in site.navigation_header %}
{% if item.url contains '://' %}
{% assign url = item.url %}
{% else %}
{% assign url = item.url | relative_url %}
{% endif %}
<li class="item item--nav{% if item.url == page.url %} item--current{% endif %}">
# read api end point
func doRequest(url string) ([]byte, error) {
resp, err := http.Get(url)
if err != nil {
return nil, err
}
defer resp.Body.Close()
return ioutil.ReadAll(resp.Body)
}
@mat-0
mat-0 / post-learning-classes-python.py
Created June 6, 2022 19:08
Post to learn classes in python
import turtle
class Polygon:
def __init__(self, sides, name, size=100, color="blue", line_thickness=4):
self.sides = sides
self.name = name
self.size = size
self.color = color
self.line_thickness = line_thickness
self.interior_angles = (self.sides - 2)*180
@mat-0
mat-0 / update-filename-json.py
Created June 5, 2022 19:17
script to update a json file using python
# importing modules
import json
import os
import pathlib
filename = os.getenv("label")
content = os.getenv("content")
root = pathlib.Path(__file__).parent.parent.resolve()
try:
@mat-0
mat-0 / post-github-issues-template.md
Created June 5, 2022 08:37
how-to-create-a-custom-issue-template-in-github
name about title labels assignees
ReadMe next activity template
For responding to my question on my ReadMe about what I should be doing next.
Next:
Next
@mat-0
mat-0 / post-php-to-python-3.yml
Created June 5, 2022 08:32
2020-09-05-php-to-python-with-GitHub-actions.md 3
name: Daily Build
# build
on:
workflow_dispatch:
schedule:
- cron: '30 7 * * *'
jobs:
build:
runs-on: ubuntu-latest
@mat-0
mat-0 / post-php-to-python-2.py
Created June 5, 2022 08:31
2020-09-05-php-to-python-with-GitHub-actions.md 2
for sign in signs :
dic = {
"#zodiac#" : sign,
"#adjOrb#" : random.choice(adjOrbs),
"#suffix#" : random.choice(suffixes),
"#gerund#" : random.choice(gerunds),
"#house#" : random.choice(houses),
"#house2#" : random.choice(houses),
"#planet#" : random.choice(planets),
"#planet2#" : random.choice(planets)
@mat-0
mat-0 / post-php-to-python-1.php
Last active June 5, 2022 08:35
2020-09-05-php-to-python-with-GitHub-actions.md 1
<?php
$string = str_replace( '#zodiac#', $go->getValueFromKey( $zodiac ) , $string );
$randHouses = $go->getValuesFromArray( $house , 2);
public function getValueFromKey(&$array) {
$rand_key = array_rand($array);
return array_pop($array);
}
public function getValuesFromArray($array, $n) {
@mat-0
mat-0 / issue-triggered-action.yml
Created June 4, 2022 19:40
Runs an action based on a label assigned to an issue, not as DRY as I would like
name: Add Item
on:
issues:
types: [labeled, edited]
jobs:
Validation:
runs-on: ubuntu-latest
if: contains(github.event.issue.labels.*.name, "labelname" )
outputs:
labelname: ${{ steps.validation.outputs.labelname }}