Skip to content

Instantly share code, notes, and snippets.

View zachisit's full-sized avatar
💭
yaaaaaaas

Zachary Smith zachisit

💭
yaaaaaaas
View GitHub Profile
@zachisit
zachisit / content.twig
Created June 10, 2021 16:05
Article html structure layout
<article>
<section class="top-pointer">
<ul>
<li class="category">cate</li>
<li>
<ul>
<li>Previous Article</li>
<li>Next Article</li>
</ul>
</li>
name: Deploy to Vapor
on:
push:
branches:
- laravel
jobs:
vapor-deploy:
name: Deploy to Vapor
on:
push:
branches:
- vapor-deploy
jobs:
vapor-deploy:
runs-on: ubuntu-latest
@zachisit
zachisit / gitlab-ci.yml
Created February 4, 2021 15:15
Flutter GitLab CI to test, analyze, and run coverage report
image: cirrusci/flutter:stable
before_script:
- flutter pub get
- flutter clean
- flutter --version
- flutter pub global activate junitreport
stages:
- analyze-and-test
@zachisit
zachisit / main.dart
Created December 1, 2020 12:08
Dart utility methods to convert a gps coordinate to Cardinal
void main() {
Map<String,dynamic> toDegreesMinutesAndSeconds(double coord) {
double absolute = coord.abs();
int degrees = absolute.floor();
double minutesNotTruncated = (absolute - degrees) * 60;
int minutes = minutesNotTruncated.floor();
double seconds = ( (minutesNotTruncated - minutes) * 60 );
return {
@zachisit
zachisit / build-and-test.yml
Created October 4, 2020 22:41
GitHub Action to build and analyze Dart code and run Flutter tests
name: Build and Test
on:
pull_request:
branches:
- master
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
@zachisit
zachisit / build-and-release.yml
Created October 4, 2020 22:39
GitHub Action to build Android APK and save as a Release
name: Build APK Release
on:
push:
tags:
- '*'
jobs:
build:
name: Build APK
runs-on: ubuntu-latest
steps:
@zachisit
zachisit / getPostsData.php
Last active February 25, 2019 19:44
PHP method to work inside WordPress to return post data array
/**
* Get Posts
*
* build array of post data
*
* @param string $post_type - could be a custom post type. defaults to 'post'
* @param string $return_number - defaults to all available posts
* @return array
*/
function getPostsData(string $post_type, string $return_number): array {
@zachisit
zachisit / copyElementToClipboard.js
Created March 2, 2018 11:48
Copy element to clipboard
$copyToClipboard.on('click', function() {
copyToClipboard($yourVarName.html()); //in this case, i am copying the html inside a div
});
/**
* Copy object to Clipboard
* @param element
*/
function copyToClipboard(element) {
var $temp = $("<input>");