Skip to content

Instantly share code, notes, and snippets.

Stanley Shyiko shyiko

Block or report user

Report or block shyiko

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
@shyiko
shyiko / weakmap.go
Created Jun 16, 2019
go sync/weakmap
View weakmap.go
package weakmap
import (
"reflect"
"runtime"
"sync"
)
type Key = interface {}
type Value = interface {}
@shyiko
shyiko / for_each.c
Created Feb 9, 2019 — forked from pancurster/for_each.c
for_each in C
View for_each.c
#include <malloc.h>
#include <string.h>
#include <stdio.h>
#define for_each(i, list) \
for(i = list; \
i != NULL; \
i = i->next)
struct lista {
@shyiko
shyiko / mvn-confict-resolver.kts
Created Aug 29, 2017
Maven Conflict Resolver
View mvn-confict-resolver.kts
// Usage:
// 1. ./mvnw dependency:tree -Dverbose | kotlinc -script mvn-confict-resolver.kts
// 2. update pom.xml's
// <dependencyManagement><dependencies><!-- INSERT 1. OUTPUT HERE --></dependencies></dependencyManagement>
import java.util.Scanner
val input = Scanner(System.`in`).useDelimiter("\\A").next()
println(
Regex("[(]([\\w.-]+:[\\w.-]+:jar:[\\w.-]+):[^ ]+ - omitted for conflict with ([\\w.-]+)")
@shyiko
shyiko / index.js
Last active Jul 26, 2017
semaphore over amqp (POC)
View index.js
const amqp = require('amqplib/callback_api')
const assert = require('assert')
amqp.connect((err, con) => {
assert.ifError(err)
console.log('connected')
con.createChannel((err, ch) => {
assert.ifError(err)
ch.prefetch(1, false)
ch.assertQueue('Q', {durable: false, autoDelete: true, maxLength: 1}, (err) => {
@shyiko
shyiko / index.html
Last active Apr 21, 2017
jsbin :: vue-document
View index.html
<!doctype html>
<title></title>
<meta name="description" content="">
<div id="app"></div>
<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/vue-document"></script>
<script>
Vue.use(VueDocument, {
injector: [VueDocument.titleInjector, VueDocument.metaInjector]
})
@shyiko
shyiko / deployment_to_gitlab_pages.md
Created Apr 10, 2017
Deploying to GitLab Pages (on each push)
View deployment_to_gitlab_pages.md

(assuming project is hosted on GitLab)

  1. Enable shared runners by going to "Settings" > "Runners".
  2. Add .gitlab-ci.yml with the following content:
image: node:6.9.1
pages: 
  artifacts: 
    paths: 
@shyiko
shyiko / index.html
Last active Dec 24, 2016
jsbin :: canvas-text-opentypejs-shim :: fabric
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>canvas-text-opentypejs-shim :: fabric</title>
</head>
<body>
@shyiko
shyiko / index.html
Last active Dec 24, 2016
jsbin :: canvas-text-opentypejs-shim
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>canvas-text-opentypejs-shim</title>
</head>
<body>
@shyiko
shyiko / google_font_downloader
Created Oct 22, 2016 — forked from jakeg/google_font_downloader
Download all Google fonts using sensible FVD-style names
View google_font_downloader
/*
Script to download all google fonts and name them with FVD-based filenames
- e.g. Rock_Salt.n4.ttf, Open_Sans.i7.ttf
*/
var https = require('https');
var http = require('http');
var fs = require('fs');
var async = require('async');
var key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; // google fonts api server-only key
View keybase.md

Keybase proof

I hereby claim:

  • I am shyiko on github.
  • I am shyiko (https://keybase.io/shyiko) on keybase.
  • I have a public key whose fingerprint is 0E9D 330A 7704 EFB3 4BB3 6842 E6A6 4EED 7505 2A29

To claim this, I am signing this object:

You can’t perform that action at this time.