Skip to content

Instantly share code, notes, and snippets.

View ilessing's full-sized avatar

Ian Lessing ilessing

  • UCSB Library
  • SoCal
View GitHub Profile
@bradtraversy
bradtraversy / myscript.sh
Last active May 15, 2024 16:27
Basic Shell Scripting
#! /bin/bash
# ECHO COMMAND
# echo Hello World!
# VARIABLES
# Uppercase by convention
# Letters, numbers, underscores
NAME="Bob"
# echo "My name is $NAME"
@eliotjordan
eliotjordan / marc.go
Last active July 2, 2019 19:47
Process MARC XML with golang
package main
import (
"encoding/xml"
"fmt"
"strings"
"time"
"io/ioutil"
"os"
)
@bladeSk
bladeSk / SQLite-PHP-quickstart.php
Last active April 30, 2024 04:16
SQLite3 PHP Quickstart Tutorial
<?php
// This file walks you through the most common features of PHP's SQLite3 API.
// The code is runnable in its entirety and results in an `analytics.sqlite` file.
// Create a new database, if the file doesn't exist and open it for reading/writing.
// The extension of the file is arbitrary.
$db = new SQLite3('analytics.sqlite', SQLITE3_OPEN_CREATE | SQLITE3_OPEN_READWRITE);
// Errors are emitted as warnings by default, enable proper error handling.
@iamluc
iamluc / symfony_docker-compose.yml
Last active December 10, 2022 13:25
Exemple of a simple docker-compose file for Symfony project with official images
#
# to execute a command in the container:
# docker exec -it XXX_web_1 su www-data -c "php app/console"
#
web:
# container_name: sf
image: php:apache
ports:
- 8888:80
@wholmgren
wholmgren / use-bbdiff
Last active February 26, 2024 02:02
set git difftool to bbdiff
git config --global diff.tool bbdiff
git config --global difftool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
git config --global difftool.prompt false
git config --global merge.tool bbdiff
git config --global mergetool.bbdiff.cmd 'bbdiff --wait --resume "$LOCAL" "$REMOTE"'
Double check ~/.gitconfig

Software for scientists

Some things takes much less time and stress once you know the right tool. Below, there is a community edited list of software for scientists.

Text editors

General purpose text/code editors. It may be better to have a good editor for everything, than different ones for different languages, scripts, notes.

@logicaroma
logicaroma / .aliases.md
Created August 14, 2013 23:17
alias shortcuts for osx and git terminal commands

Easier navigation: .., ..., ...., ....., ~ and -

alias ..="cd .." alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.." alias ~="cd ~" # cd is probably faster to type though alias -- -="cd -"

Shortcuts

alias d="cd ~/Documents/Dropbox"

@willurd
willurd / web-servers.md
Last active May 21, 2024 09:23
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@ccstone
ccstone / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active May 10, 2024 15:41
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
@marktheunissen
marktheunissen / pedantically_commented_playbook.yml
Last active April 26, 2024 23:26 — forked from phred/pedantically_commented_playbook.yml
Insanely complete Ansible playbook, showing off all the options
This playbook has been removed as it is now very outdated.