Skip to content

Instantly share code, notes, and snippets.

@semicon
semicon / code.gs
Last active June 13, 2024 03:29
CRUD Web Apps
const folder = DriveApp.getFolderById('xxxxxx') //change
const ss = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('xxx') //change
const data = ss.getDataRange().getDisplayValues()
function doGet() {
return HtmlService.createTemplateFromFile('index').evaluate()
.addMetaTag('viewport', 'width=device-width, initial-scale=1')
.setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL)
}
@lvnilesh
lvnilesh / docker-compose.yaml
Created April 28, 2024 02:20
self-hosted network-isolated vaultwarden
---
services:
bitwarden:
container_name: vault
hostname: vault
image: vaultwarden/server:1.30.5-alpine
restart: always
volumes:
- /etc/localtime:/etc/localtime:ro
- $PWD/log:/var/log/vaultwarden
@jdtsmith
jdtsmith / repeat-change-cursor-color.el
Last active June 13, 2024 03:26
Emacs: change cursor color during active repeat-mode commands
(let ((orig (default-value 'repeat-echo-function))
rcol ccol in-repeat)
(setq
repeat-echo-function
(lambda (map)
(if orig (funcall orig map))
(unless rcol (setq rcol (face-foreground 'error)))
(if map
(unless in-repeat ; new repeat sequence
(setq in-repeat t
@7shi
7shi / Program.fs
Created April 12, 2012 17:59
独自実装Deflateで最適化を頑張ってみた。
open System
open System.IO
let sin = new FileStream(@"foo", FileMode.Open)
let sout = new FileStream(@"foo.deflate", FileMode.Create)
let t1 = DateTime.Now
let w = new Deflate.Writer(sin)
w.Compress sout
sout.Close()
sin.Close()
@danielytics
danielytics / glfw.cpp
Created February 14, 2021 19:48
OpenGL with SDL and GLFW
// Code taken from GLFW documentation: https://www.glfw.org/documentation.html
#include <GLFW/glfw3.h>
int main(void)
{
GLFWwindow* window;
/* Initialize the library */
if (!glfwInit())
return -1;
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active June 13, 2024 03:22
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@v1mkss
v1mkss / JetBrains Activation.md
Last active June 13, 2024 03:20
JetBrains Activation

JetBrains Activation

  • No proxy for:
*.apache.org, *.github.com, *.github.io, *.githubusercontent.com, *.gitlab.com, *.google.com, *.gradle.org, *.jetbrains.space, *.maven.org, *.micronaut.io, *.quarkus.io, *.scala-sbt.org, *.schemastore.org, *.spring.io, cache-redirector.jetbrains.com, cloudconfig.jetbrains.com, download-cdn.jetbrains.com, download.jetbrains.com, downloads.marketplace.jetbrains.com, ea-report.jetbrains.com, github.com, gitlab.com, google.com, gradle.org, jcenter.bintray.com, jitpack.io, micronaut.io, plugins.jetbrains.com, quarkus.io, repo.papermc.io, resources.jetbrains.com, spring.io, www.jetbrains.com

Activation Key:

UX394X3HLT-eyJsaWNlbnNlSWQiOiJVWDM5NFgzSExUIiwibGljZW5zZWVOYW1lIjoiSG9uZ2lrIFVuaXZlcnNpdHntmY3snbXrjIDtlZnqtZAiLCJsaWNlbnNlZVR5cGUiOiJDTEFTU1JPT00iLCJhc3NpZ25lZU5hbWUiOiLkvJfliJvkupEg5bel5L2c5a6kIiwiYXNzaWduZWVFbWFpbCI6ImhhbmF6YXdhbWl0b0BnbWFpbC5jb20iLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiJG
# Disallow all crawlers access to certain pages.
# Block Yandex from crawling site
User-agent: Yandex
Disallow: /
# Block Yeti
User-agent: Yeti
Disallow: /
@gcatlin
gcatlin / glfw-metal-example.m
Last active June 13, 2024 03:16
Minimal C GLFW Metal example
//
// cc glfw-metal-example.m `pkg-config --cflags --libs glfw3` -framework AppKit -framework Metal -framework QuartzCore
//
#define GLFW_INCLUDE_NONE
#define GLFW_EXPOSE_NATIVE_COCOA
#include <GLFW/glfw3.h>
#include <GLFW/glfw3native.h>
#import <Metal/Metal.h>
#import <QuartzCore/CAMetalLayer.h>
@YimianDai
YimianDai / Submit-PR.md
Last active June 13, 2024 03:14
向开源项目提交 Pull Request

步骤

Part 1 - Local Repo Config

  1. 先 Fork 感兴趣项目,即 dmlc/gluon-cv
  2. Clone 到本地,git clone git@github.com:YimianDai/gluon-cv.git
  3. 添加源项目 dmlc/gluon-cv 作为 upstream 源,git remote add upstream https://github.com/dmlc/gluon-cv.git
  4. 禁止直接向 upstream 源 push,因为我们不是 dmlc 的人,没有 push 的权限,要提交代码必须通过 Pull Request,git remote set-url --push upstream no_push
  5. 创建并切换到本地的新分支 fixMixSoftmaxCrossEntropyLossgit checkout -b fixMixSoftmaxCrossEntropyLoss