Skip to content

Instantly share code, notes, and snippets.

View tisseurdetoile's full-sized avatar
🏠
confiné

tisseurdetoile tisseurdetoile

🏠
confiné
View GitHub Profile
@tdd
tdd / gitconfig.ini
Last active October 29, 2024 15:45
Nice, useful global Git configuration
# Put this in your ~/.gitconfig or ~/.config/git/config
# Windows users: "~" is your profile's home directory, e.g. C:\Users\<YourName>
[user]
name = Your Full Name
email = [email protected]
[color]
# Enable colors in color-supporting terminals
ui = auto
[alias]
# List available aliases
@tisseurdetoile
tisseurdetoile / sqlitetojson.awk
Created March 14, 2013 13:19
json output fromage sqlite select
# sqlitetojson.awk
# convert SQL SELECT Result from sqlite to json
# usage : sqlite3 -header dbfilename 'SELECT * FROM database' | awk -f sqlitetojson.awk
# nota : -header is mandatory
BEGIN {
FS="|";
nh = 0;
printf "[";
}
NR==1 {
@mendelgusmao
mendelgusmao / btsync
Last active March 4, 2021 15:37
init.d script for btsync (based on another script built to run dropbox)
#!/bin/sh
### BEGIN INIT INFO
# Provides: btsync
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multi-user daemonized version of btsync.
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active November 5, 2024 15:51
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@robwierzbowski
robwierzbowski / contributing.md
Last active January 24, 2018 19:15
Simple rules for contributing to GitHub repositories. Edits encouraged.

Hi! Thanks for using this project. I had a lot of fun building it, and I hope you're having fun using it too.

If you have an error or support request

  • Read the error message and documentation.
  • Search existing issues, closed issues, and the internet first.
  • If the issue is with a dependency of this project, post on the dependency's repo.
  • If you can fix the issue, submit a PR 👍 💃 💃 🚀.
  • If the issue persists, post on the issue tracker. Include any information that could help others reproduce and fix.
@tisseurdetoile
tisseurdetoile / BACKUP.SH
Last active January 23, 2018 01:37
backup my PI to my NAS with rsync
#!/bin/bash
HOSTNAME=`hostname`
SERVER="SRVHOST"
USERNAME="USER"
export RSYNC_PASSWORD="password"
PREFIX="/backup"
AREXCLUDE=( "/dev/*" "/proc/*" "/sys/*" "tmp/*" "/run/*" "/mnt/*" "/media/*" "lost+found" "/usr/share/*" "/lib/*" "/var/lib/*" "/usr/lib/*" "/var/swap" "/var/cache/*" "/var/lock/*" "/var/run/*")
START=$(date +%s)
DAYNUM=`date '+%u'`
@imbradbrown
imbradbrown / upload-ssec.sh
Last active November 30, 2022 06:20
Uploading to Amazon S3 from curl with Server Side Encrpytion - Customer Provided Key used. Note that this uses the Amazon Access Keys which should be used with care.
#!/bin/bash
## file to upload.
S3_UPLOAD_FILE=some/path/file.txt
## Specify the bucket name here. This can be found in the S3 console
S3_BUCKET=bucket name here
## The desired path relative to the root of the bucket. All folders must be forward slash '/' separated
S3_DESTINATION_FILE=folder/folder2/file.txt
@JamesMessinger
JamesMessinger / IndexedDB101.js
Last active October 16, 2024 09:40
Very Simple IndexedDB Example
// This works on all devices/browsers, and uses IndexedDBShim as a final fallback
var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB || window.shimIndexedDB;
// Open (or create) the database
var open = indexedDB.open("MyDatabase", 1);
// Create the schema
open.onupgradeneeded = function() {
var db = open.result;
var store = db.createObjectStore("MyObjectStore", {keyPath: "id"});
@thomasdarimont
thomasdarimont / App.java
Last active July 10, 2023 12:19
How to use custom SpEL functions in @value with Spring Boot
package demo;
import static java.lang.reflect.Modifier.*;
import java.util.Arrays;
import java.util.Set;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.BeanExpressionResolver;
@PurpleBooth
PurpleBooth / README-Template.md
Last active November 19, 2024 11:04
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites