Skip to content

Instantly share code, notes, and snippets.

🌴
On vacation

Yarco yarcowang

🌴
On vacation
Block or report user

Report or block yarcowang

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
@yarcowang
yarcowang / config.php
Last active Jun 20, 2019 — forked from jarektkaczyk/config.php
Laravel - tinker like a boss (with PsySH)
View config.php
<?php // ~/.config/psysh/config.php
// Anything not Laravel - let's try to autoload something likely to exist
if (!defined('LARAVEL_START')) {
return [
'defaultIncludes' => [
getcwd().'/vendor/autoload.php',
getcwd().'/bootstrap/autoload.php',
],
];
View gist:40364ac0fc1908104423def6f61e6a6e
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
char name[10];
} Person;
int main() {
// initialize to empty
@yarcowang
yarcowang / tom.md
Last active Jul 21, 2016
TOML -> TOM: from TOML to TOM
View tom.md

TOM

This is a modification version of original TOML by Tom Preston-Werner cause i thought:

  • it should be more simple
  • it can be not called as a language (as a developer, i'm lost in a lot of programming languages, tired anyway...)

Objectives

@yarcowang
yarcowang / CRDJ.md
Last active Dec 13, 2015
Common Reference Doc in Json format
View CRDJ.md

Common Reference Doc in Json format

Notice:

  • Pages here are all in json format, not normal html page.
  • items appears in path are all in lowercase, ex. :modulename
  • only fields in bold are the required fields

Doc Site in JSON

Common

The docsite should add Access-Control-Allow-Origin to allow cross json requsest.

@yarcowang
yarcowang / docker-log.sh
Last active Jul 24, 2017
simple bash script to show log for a docker image
View docker-log.sh
#!/usr/bin/env bash
DOCKER=`which docker`
usage()
{
echo "Usage: $(basename $0) [-l num] IMAGE"
exit 0
}
@yarcowang
yarcowang / gist:8969090
Last active Aug 29, 2015
what about adding a internal template engine into html5?
View gist:8969090

There are two techs when thinking about html5 template system.

  • template system ---- deal with UI/view
  • data binding ---- deal with model

template system

template can be local and global.

  • local template parse and load on fly
@yarcowang
yarcowang / gist:4173695
Last active Oct 13, 2015
Common Project Initialize Procedure
View gist:4173695

Common Project Initialize Procedure

This common style is for me in developer eye. You could also follow it by yourself.

Name a project

The very beginning thing is you need to name a project. It is really very important when starting a project. No name, then no project.

  • name should be in english, and should less than 20 characters
@yarcowang
yarcowang / gist:4160360
Last active Oct 13, 2015
Common Comment Style
View gist:4160360

Common Comment Style

Cause i didn't find a useful one, i try to define it for personal using. So some rules are strict.

These ideas come from javadoc and doxygen.

Common rule

  • markdown for the format of internal comment
  • do not comment everywhere, you are doing coding not commenting
View rgb2gray.js
/**
原始 = rgba(255,0,0,.5) + rgba(0,255,0,.5): <br />
<canvas id="item0" width="120" height="120">
您的浏览器不支持html5
</canvas>
<br />
灰度:<br />
<canvas id="item1" width="360" height="120">
您的浏览器不支持html5
</canvas>
You can’t perform that action at this time.