Skip to content

Instantly share code, notes, and snippets.

@guannie
guannie / app.js
Last active August 21, 2023 17:08
testembed
document.addEventListener('DOMContentLoaded', function() {
const num1Input = document.getElementById('num1');
const num2Input = document.getElementById('num2');
const operationSelect = document.getElementById('operation');
const calculateButton = document.getElementById('calculate');
const resultElement = document.getElementById('result');
calculateButton.addEventListener('click', function() {
const num1 = parseFloat(num1Input.value);
const num2 = parseFloat(num2Input.value);
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@guannie
guannie / is-private-mode.js
Created May 27, 2021 15:21 — forked from jherax/is-private-mode.js
Detect if the browser is running in Private mode (Promise based)
/**
* Lightweight script to detect whether the browser is running in Private mode.
* @returns {Promise<boolean>}
*
* Live demo:
* @see https://output.jsbin.com/tazuwif
*
* This snippet uses Promises. If you want to run it in old browsers, polyfill it:
* @see https://cdn.jsdelivr.net/npm/es6-promise@4/dist/es6-promise.auto.min.js
*
/**
* This script contains WAPI functions that need to be run in the context of the webpage
*/
/**
* Auto discovery the webpack object references of instances that contains all functions used by the WAPI
* functions and creates the Store object.
*/
if (!window.Store) {
(function () {
@guannie
guannie / penguin.html
Created May 10, 2019 14:45
A cute penguin using HTML and CSS
<style>
.penguin {
/* change code below */
--penguin-skin: gray;
--penguin-belly: white;
--penguin-beak: orange;
/* change code above */
position: relative;
#!/usr/bin/env python
# origin from https://www.biostars.org/p/15138/
"""
Convert genbank to gtf.
USAGE:
cat file.gb | gb2gtf.py > file.gtf
NOTE:
It's designed to work with gb files coming from GenBank. gene is used as gene_id and transcript_id (locus_tag if gene not present).

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@guannie
guannie / swipetab.html
Last active November 27, 2018 02:32
A swipetab reimplementation
<ion-header>
<ion-navbar>
<ion-title>Swipe Tab</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<ion-segment class="SwipedTabs-tabs" >
<ion-segment-button *ngFor='let tab of tabs ; let i = index ' value="IngoreMe" (click)="selectTab(i)"
@guannie
guannie / simulator_launcher.sh
Last active November 25, 2018 13:49
Script for launching android emulator
#!/bin/bash
#linux
cd ~/Android/Sdk/emulator/
#mac default location
# cd ~/Library/Android/sdk/emulator/
#windows(powershell) default location
# cd ~\AppData\Local\Android\Sdk\emulator
avds=`./emulator -list-avds`
echo "show All emulators"
i=0
@guannie
guannie / enable_cors_php
Created September 19, 2018 04:38
script to enable cors sharing in php
//*
// Allow from any origin
if (isset($_SERVER['HTTP_ORIGIN'])) {
// Decide if the origin in $_SERVER['HTTP_ORIGIN'] is one
// you want to allow, and if so:
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}");
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Max-Age: 86400'); // cache for 1 day
}