Skip to content

Instantly share code, notes, and snippets.

View levic's full-sized avatar

Levi Cameron levic

View GitHub Profile
@levic
levic / results-python3.11.txt
Last active March 22, 2023 04:03 — forked from djfroofy/performance_results.txt
Lists vs. StringIO vs. Regular String Concat for building strings in Python
=================================
Python 3.11
=================================
Concatenating 5 strings...
build_ul_list : 1.0
build_ul_stringio : 1.629
build_ul_concat : 1.013
Concatenating 32 strings...
build_ul_list : 1.0
build_ul_stringio : 1.356
@levic
levic / astrosetup.bash
Created January 29, 2023 10:56
astro with yarn berry doesn't set vite allow directory correctly
yarn set version berry
yarn config set enableGlobalCache true
yarn create astro@latest
# (astro v2.0.2)
# choose defaults for everything except project name:
# - project name: myproject
# - a few best practices
# - install yarn dependencies: yes
@levic
levic / Output
Created May 26, 2019 15:21
C vs C++ startup cost
- ITERATIONS=15000
- OS: macOS 10.14.5
- Compiled using clang with -O3
Output:
running 15000 iterations for ./a.out.c
done
elapsed: 26.145948sec
1.743ms per iteration
@levic
levic / minimal location services
Last active August 29, 2015 14:10
Minimal cordova location services example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
</head>
<body>
<div>
<p style="margin-top: 60px;" class="state">State: <span class="data"></span></p>
<input class="start" type="button" value="Start" />
@levic
levic / actionsheetdemo.html
Last active January 27, 2017 07:26
Demonstration of double tap actionsheet behaviour in jqtouch
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="css/lib/jqtouch/css/jqtouch.css" />
<link rel="stylesheet" type="text/css" href="css/lib/jqtouch/extensions/jqt.actionsheet.css" />
<title>Actionsheet Demo</title>
</head>
<body>
<div id="jqt">