Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
surfing the Ballmer Curve

turnspike turnspike

🔥
surfing the Ballmer Curve
View GitHub Profile
@keithrbennett
keithrbennett / organize-av-files
Last active Oct 11, 2019
Helps separate your audio and video files into saves and deletes using Ruby and MPlayer.
View organize-av-files
#!/usr/bin/env ruby
# organize-av-files - Organizes files playable by mplayer
# into 'saves', 'deletes', and 'undecideds' subdirectories
# of the current working directory.
#
# Be careful, if you specify files to process in multiple directories,
# they will all be moved to the same subdirectories, so they will no
# longer be organized by directory, and if there are multiple files
# of the same name, some may be lost if overwritten.
@safijari
safijari / orgmode_spacemacs.org
Last active Nov 10, 2021
Org mode spacemacs tutorial file
View orgmode_spacemacs.org

I hope the tutorial has been useful to you. If it was kindly leave a like and a comment, and consider subscribing and turning on subscription notifications. I intend to make more videos like this on the topics mentioned before as well as on other spacemacs topic like magit (git plugin), large scale refactoring, and a number of other things. Thank you so much for watching.

Org tutorial

Note: a great reference can be had here http://spacemacs.org/layers/+emacs/org/README.html

Outlines/headers

Show that each outline has it’s associated “text” under it

@sinclairtarget
sinclairtarget / bernoulli.c
Created Aug 17, 2018
Lovelace's Note G Program in C
View bernoulli.c
#include <stdio.h>
/*
* Calculates what Ada Lovelace labeled "B7", which today we would call the 8th
* Bernoulli number.
*/
int main(int argc, char* argv[])
{
// ------------------------------------------------------------------------
// Data
View init.el
;;; Bootstrap
(setq gc-cons-threshold most-positive-fixnum)
(package-initialize)
;; Load customizations
(setq custom-file (locate-user-emacs-file "custom.el"))
(load custom-file)
@bgromov
bgromov / git-reset-author.sh
Created Jun 23, 2016
Git: reset author for ALL commits
View git-reset-author.sh
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@ZhengRui
ZhengRui / .vimrc
Last active Jan 23, 2017
ubuntu14.04 vim and neovim configuration
View .vimrc
" add for vundle
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
@unhammer
unhammer / .mbsyncrc
Last active Mar 9, 2018
isync + dovecot + gnus with Fastmail
View .mbsyncrc
IMAPAccount fastmail
Host imaps:mail.messagingengine.com
User me@fastmail.com
# you may have to tweak the awk here + filename to your netrc/authinfo:
PassCmd "gpg2 -q --for-your-eyes-only --no-tty -d $HOME/.netrc.gpg | awk '$2==\"mail.messagingengine.com\" && $4==\"me@fastmail.com\" {print $6;exit(0)}'"
Port 992
# Port 992 has a "flat" hierarchy; use with
# mail_location = maildir:~/.Maildir/:LAYOUT=fs:INBOX=~/.Maildir/INBOX
# in dovecot (see also MaildirStore.Inbox below)
@syafiqfaiz
syafiqfaiz / how-to-copy-aws-rds-to-local.md
Last active Nov 16, 2021
How to copy production database on AWS RDS(postgresql) to local development database.
View how-to-copy-aws-rds-to-local.md
  1. Change your database RDS instance security group to allow your machine to access it.
    • Add your ip to the security group to acces the instance via Postgres.
  2. Make a copy of the database using pg_dump
    • $ pg_dump -h <public dns> -U <my username> -f <name of dump file .sql> <name of my database>
    • you will be asked for postgressql password.
    • a dump file(.sql) will be created
  3. Restore that dump file to your local database.
    • but you might need to drop the database and create it first
    • $ psql -U <postgresql username> -d <database name> -f <dump file that you want to restore>
    • the database is restored
View spacemacs-cheshe.md

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
View spacemacs-cheatsheet.md

emacs --daemon to run in the background. emacsclient.emacs24 <filename/dirname> to open in terminal

NOTE: "M-m and SPC can be used interchangeably".

  • Undo - C-/
  • Redo - C-?
  • Change case: 1. Camel Case : M-c 2. Upper Case : M-u 3. Lower Case : M-l