Skip to content

Instantly share code, notes, and snippets.

View lastlink's full-sized avatar
:octocat:
branching out

lastlink lastlink

:octocat:
branching out
View GitHub Profile
@natsumerinchan
natsumerinchan / bilibili-daily-task.yml
Created May 23, 2023 05:11
BiliBili Auto Checkin
# 每日任务
name: bilibili-daily-task
on:
workflow_dispatch: # 手动触发
schedule: # 计划任务触发
- cron: '0 0 * * *'
@porterde
porterde / ci.yml
Last active April 24, 2020 13:03
Work around to enable SonarCloud GitHub Actions to scan Vue.js files containing TypeScript
# Work around for issue described here:
# https://community.sonarsource.com/t/sonarqube-scanner-fails-to-analyze-vue-files-failed-to-parse-file-vue/17751/2
# https://jira.sonarsource.com/browse/MMF-1441
# This is for use in a GitHub Actions script using the SonarCloud GitHub Action which runs the scanner in Docker.
# If you're running Sonar scanner outside of GitHub Actions this hack certainly requires changes to make
# it work - I wish you luck!
#
# The basic idea in the hack is to run an Nginx docker container, alongside the Sonar scanner container,
# as a proxy for sonarcloud.io. Nginx intercepts the request to download the javascript scanning plugin
@ChrisTaylorDeveloper
ChrisTaylorDeveloper / vs-code-php-debug-docker-xdebug.md
Last active April 7, 2022 05:31
How to configure the PHP-Debug extension for VS Code when serving the PHP project from Docker with xdebug

The Dockerfile

Only add the xdebug.remote_log line if you need to troubleshoot.

FROM php:7.1-apache

RUN yes | pecl install xdebug \
    && echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
    && echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
    && echo "xdebug.remote_autostart=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
@mholt
mholt / macapp.go
Last active April 8, 2024 17:54
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@luyx2412
luyx2412 / google-drive.js
Last active July 14, 2021 13:03
React native login google, and google drive. Save storage and get again data when uninstall app.
/**
* Google Drive
* created by luyxtran264@gmail.com
*/
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
Text,
@LivingInSyn
LivingInSyn / lib.rs
Last active December 11, 2020 03:17
//using statements
use std::os::raw::c_char;
use std::ffi::CString;
//static var
static mut STRING_POINTER: *mut c_char = 0 as *mut c_char;
///structs
#[repr(C)]
pub struct SampleStruct {
pub field_one: i16,
@bradwestfall
bradwestfall / S3-Static-Sites.md
Last active April 10, 2024 16:40
Use S3 and CloudFront to host Static Single Page Apps (SPAs) with HTTPs and www-redirects. Also covers deployments.

S3 Static Sites

⚠ This post is fairly old. I don't keep it up to date. Be sure to see comments where some people have posted updates

What this will cover

  • Host a static website at S3
  • Redirect www.website.com to website.com
  • Website can be an SPA (requiring all requests to return index.html)
  • Free AWS SSL certs
  • Deployment with CDN invalidation

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@wojteklu
wojteklu / clean_code.md
Last active May 10, 2024 21:32
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@steinwaywhw
steinwaywhw / One Liner to Download the Latest Release from Github Repo.md
Last active May 5, 2024 20:02
One Liner to Download the Latest Release from Github Repo
  • Use curl to get the JSON response for the latest release
  • Use grep to find the line containing file URL
  • Use cut and tr to extract the URL
  • Use wget to download it
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \