Skip to content

Instantly share code, notes, and snippets.

@gkhays
gkhays / DrawSineWave.html
Last active April 27, 2024 06:01
Oscillating sine wave, including the steps to figuring out how to plot a sine wave
<!DOCTYPE html>
<html>
<head>
<title>Sine Wave</title>
<script type="text/javascript">
function showAxes(ctx,axes) {
var width = ctx.canvas.width;
var height = ctx.canvas.height;
var xMin = 0;
@AlexMax
AlexMax / retroarch.md
Last active March 21, 2024 20:10
Setting up RetroArch on a Raspberry Pi

Setting up RetroArch on a Raspberry Pi

I just put the finishing touches on my Raspberry Pi 3 emulation machine running RetroArch. I was not a huge fan of RetroPie due to the reliance on Emulation Station - more moving parts meant that there were more things that could potentially break. I just wanted something that would run raw RetroArch, no frills.

This tutorial is mostly recreated from memory and was most recently tested with a Raspberry Pi 3 running Raspbian Stretch and RetroArch 1.7.7. If there is a mistake or a broken link, PLEASE message me and I will fix it.

Step 1: Install Raspbian

I used Raspbian Stretch Lite from this page. Write the image to your SD card using something like Win32 Disk Imager, or if you're using OSX/Linux follow a tutorial on how to write the image using dd.

@arronmabrey
arronmabrey / spacemacs-git-gutter-with-linum.el
Last active May 10, 2019 07:51
Config git-gutter with linum in Spacemacs
(defun dotspacemacs/layers ()
(setq-default
dotspacemacs-configuration-layers
'((version-control :variables
version-control-global-margin t
version-control-diff-tool 'git-gutter
))))
(defun dotspacemacs/init ()
@adham90
adham90 / spacemacs-keybindings
Last active April 5, 2024 14:24
spacemacs keybindings that i need to learn
SPC s c remove highlight
**** Files manipulations key bindings
Files manipulation commands (start with ~f~):
| Key Binding | Description |
|-------------+----------------------------------------------------------------|
| ~SPC f c~ | copy current file to a different location |
| ~SPC f C d~ | convert file from unix to dos encoding |
| ~SPC f C u~ | convert file from dos to unix encoding |

This is unmaintained, please visit Ben-PH/spacemacs-cheatsheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
@padawanphysicist
padawanphysicist / emacs-pkg-install.sh
Last active February 24, 2023 02:03
Install emacs packages from the command-line
#!/bin/bash
#
# I wrapped the code constructed in
#
# http://hacks-galore.org/aleix/blog/archives/2013/01/08/install-emacs-packages-from-command-line
#
# in a single bash script, so I would a single code snippet.
#
# Package to be installed

@kangax's ES6 quiz, explained

@kangax created a new interesting quiz, this time devoted to ES6 (aka ES2015). I found this quiz very interesting and quite hard (made myself 3 mistakes on first pass).

Here we go with the explanations:

Question 1:
(function(x, f = () =&gt; x) {
@eu81273
eu81273 / .tigrc
Last active November 2, 2023 06:51
Tig 모든 기본 설정 + 커스텀
# Tig 기본 설정
# 'man tigrc' 를 커맨드라인에서 입력하면 전체 매뉴얼을 볼 수 있다.
# 매뉴얼 한글 번역 http://ujuc.github.io/2016/02/10/tig-manual/
# 설정
# --------
# 여기에 있는 대부분의 설정들은 toggle-* 이나 옵션 메뉴(기본값은 'o' 키)를 통해 토글할 수 있다.
# 뷰 설정
#
@Integralist
Integralist / bash-array-shift.sh
Last active March 7, 2022 05:27
Zsh and Bash Array Shift (remove first item from the Array)
array=(foo, bar, baz)
echo ${array[@]} # => foo, bar, baz
array=("${array[@]:1}")
echo ${array[@]} # => bar, baz
array=("${array[@]:1}")
echo ${array[@]} # => baz
@TheBB
TheBB / loading.org
Last active June 22, 2023 11:53
Loading in Spacemacs

Emacs packages, features, files, layers, extensions, auto-loading, require, provide, use-package… All these terms getting you confused? Let’s clear up a few things.

Files

Emacs files contains code that can be evaluated. When evaluated, the functions, macros and modes defined in that file become available to the current Emacs session. Henceforth, this will be termed as loading a file.

One major problem is to ensure that all the correct files are loaded, and in the