Skip to content

Instantly share code, notes, and snippets.

@jorgebucaran
jorgebucaran / index.html
Last active July 14, 2020 06:37
Getting started with Hyperapp
<!DOCTYPE html>
<html lang="en">
<head>
<script type="module">
import { h, text, app } from "https://unpkg.com/hyperapp"
app({
init: () => 0,
view: state =>
h("main", {}, [
@simeji
simeji / get_repo_stars.sh
Last active August 29, 2022 07:38
Get count of Github repository stars
#!/bin/bash
USER=$1
REPO=$2
if [ -z "$USER" -o -z "$REPO" ]; then
echo '$1 : Github username, $2: Github repository name (only public repo)'
exit 1
fi
FILENAME=star_${USER}_${REPO}
@ThadeuLuz
ThadeuLuz / Dialog.jsx
Last active July 4, 2018 21:59
This is a fix of several problems I had when using the vanilla Material-ui Dialog like using javascript for height, lack of full screen for mobile, having to choose the body scroll visibility regardless of screen/content size and the body scroll position in some browsers. Tested on latest chrome and safari only. Please let me know if you think i…
import React, { PropTypes } from 'react';
import MDialog from 'material-ui/Dialog';
import './dialog.css';
const Dialog = props => (
<MDialog
{...props}
repositionOnUpdate={false}
autoDetectWindowHeight={false}
@iamralch
iamralch / compress.go
Last active April 16, 2023 03:04
ZIP archives in Golang
import (
"archive/zip"
"io"
"os"
"path/filepath"
"strings"
)
func zipit(source, target string) error {
zipfile, err := os.Create(target)