Skip to content

Instantly share code, notes, and snippets.

View aschmelyun's full-sized avatar

Andrew Schmelyun aschmelyun

View GitHub Profile
@aschmelyun
aschmelyun / settings.json
Created November 16, 2021 05:54
VS Code Settings
{
"editor.codeLens": false,
"workbench.colorTheme": "Atom One Dark",
"editor.quickSuggestions": {
"other": false,
"comments": false,
"strings": false
},
"editor.selectionHighlight": false,
"editor.highlightActiveIndentGuide": false,
@aschmelyun
aschmelyun / seed.js
Created July 23, 2021 03:25
Test remote seeding of json-server
const data = {
users: []
};
for (let i=0; i<100; i++) {
data.users.push({
id: i,
name: `User #${i}`
});
}
@aschmelyun
aschmelyun / settings.json
Created April 17, 2021 07:05
My current VS Code settings file
{
"editor.codeLens": false,
"workbench.activityBar.visible": false,
"window.zoomLevel": 1,
"workbench.colorTheme": "One Dark Pro",
"editor.quickSuggestions": {
"other": false,
"comments": false,
"strings": false
},
@aschmelyun
aschmelyun / cr2_to_jpg.sh
Created December 5, 2020 00:55
Bash script to convert CR2 images to JPG using dcraw
#!/usr/bin/bash
# usage ./cr2_to_jpg.sh /path/to/cr2/images/ /path/to/converted/jpgs/
i=1
total=$(find $1 -type f | wc -l)
for file in $1*.CR2
do
dcraw -c -w -b 1.5 $file | pnmtojpeg > $2$(basename $file .CR2).jpg
@aschmelyun
aschmelyun / windows-macos-keybindings.ahk
Last active November 10, 2023 22:19
AutoHotKey script for enabling alt-tab on a Windows system after switching the Alt and Ctrl keys
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
LCtrl & Tab:: AltTab
!Tab:: Send ^{Tab}
!+Tab:: Send ^+{Tab}
^Space:: Send ^{Esc}
@aschmelyun
aschmelyun / bash
Last active February 19, 2020 07:51
docker-compose run --rm npm run gulpwatch
@aschmelyun
aschmelyun / index.html
Last active February 9, 2024 01:49
In AR.js display a video which transitions into an image on completion
<!DOCTYPE html>
<html>
<head>
<title>AR Demo</title>
<script src="https://aframe.io/releases/0.6.1/aframe.min.js"></script>
<script src="https://jeromeetienne.github.io/AR.js/aframe/build/aframe-ar.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<meta name="apple-mobile-web-app-capable" content="yes">
<script>
// We're going to register a custom event listener through a-frame that will fire
@aschmelyun
aschmelyun / DetectScroll.vue
Created May 29, 2018 09:19
Detect scrolling to the bottom of a div in Vue.js
<template>
<div class="wrapper">
<div class="box" @scroll="handleScroll">
<p>Your content here...</p>
</div>
<a href="#" v-if="hasScrolledToBottom">Show After Scrolling</a>
</div>
</template>
<script>
export default {
const int ledPin = 0;// the number of the LED pin
// Variables will change :
int ledState = LOW; // ledState used to set the LED
// Generally, you should use "unsigned long" for variables that hold time
// The value will quickly become too large for an int to store
unsigned long previousMillis = 0; // will store last time LED was updated
// constants won't change :
@aschmelyun
aschmelyun / index.php
Created October 1, 2015 19:01
Convert .png images to HTML divs
<?php
$img = imagecreatefrompng('test.png');
$img_width = imagesx($img);
$img_height = imagesy($img);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Convert useless images to beautiful HTML!</title>
<style>