Skip to content

Instantly share code, notes, and snippets.

View sergiitk's full-sized avatar
🐍
Sneks.

Sergii Tkachenko sergiitk

🐍
Sneks.
View GitHub Profile
# Drupal watchdog facility has its own log file
? [= Sender drupal] claim only
> /var/log/watchdog.log mode=0644 format=bsd rotate=seq compress file_max=5M all_max=50M
* file /var/log/watchdog.log
@voxpelli
voxpelli / vptest.info
Created July 5, 2011 20:01
OAuth.module 3.x example - a test I made to verify the D7 port of the module - should work well on D6 as well though
name = VoxPelli OAuth Test
core = 7.x
dependencies[] = oauth_common
dependencies[] = http_client
@NOTtheMessiah
NOTtheMessiah / Dr. Krieger's ASCII Bound.ipynb
Created April 30, 2016 05:21
Clue from the Archer Scavenger Hunt
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@RobSpectre
RobSpectre / app.py
Created April 27, 2017 21:49
Example of using Celery for Quasar Queue
from flask import Flask
from flask import request
from tasks import store_db
app = Flask(__name__)
@app.route('/blink', methods=['GET', 'POST'])
def blink():
@leesmith
leesmith / commit-message-syntax.txt
Created December 31, 2011 06:05
Pivotal Tracker post-commit message syntax
https://www.pivotaltracker.com/help/api?version=v3#github_hooks
https://www.pivotaltracker.com/help/api?version=v3#scm_post_commit_message_syntax
SCM Post-Commit Message Syntax
To associate an SCM commit with a specific Tracker story, you must include a special syntax in the commit message to indicate one or more story IDs and (optionally) a state change for the story. Your commit message should have square brackets containing a hash mark followed by the story ID. If a story was not already started (it was in the "not started" state), a commit message will automatically start it. For example, if Scotty uses the following message when committing SCM revision 54321:
[#12345677 #12345678] Diverting power from warp drive to torpedoes.
@drfloob
drfloob / is_branch_merged.sh
Last active November 18, 2021 22:36
A script to check if branch A has been squash-merged to branch B (default: master) by evaluating diffs of branch A vs diff of all commits on branch B
#!/bin/bash
set -e
function cleanup {
rm $DIFF_FILE $TMPFILE
}
trap cleanup EXIT
@scottstanfield
scottstanfield / osx-defaults.sh
Created July 18, 2016 03:40
Lots of OSX defaults
#!/bin/sh
# 90% from http://mths.be/osx
# ask for admin password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@jimschubert
jimschubert / README.md
Last active October 30, 2023 01:33
prepare-commit-msg which adds branch name and description to the end of a commit message (git hook)

Installation

To install globally, copy prepare-commit-msg to /usr/local/share/git-core/templates/hooks and execute:

chmod +x /usr/local/share/git-core/templates/hooks/prepare-commit-msg

To install per-repository, copy prepare-commit-msg to /path/to/repo/.git/hooks/prepare-commit-msg and mark it as executable.

; acceleration_enabled = {acceleration_enabled}
; acceleration_infill = {acceleration_infill}
; acceleration_ironing = {acceleration_ironing}
; acceleration_layer_0 = {acceleration_layer_0}
; acceleration_prime_tower = {acceleration_prime_tower}
; acceleration_print = {acceleration_print}
; acceleration_print_layer_0 = {acceleration_print_layer_0}
; acceleration_roofing = {acceleration_roofing}
; acceleration_skirt_brim = {acceleration_skirt_brim}
; acceleration_support = {acceleration_support}
@sergiitk
sergiitk / shell-tools.md
Last active January 5, 2025 12:29
Useful shell tools

Useful shell tools (BSD)

Strings

  • l | tail +2 — Skip first line of stdout
  • l | head -n-1 — Skip last line of stdout (GNU version only)
  • echo "test" | head -c-1 — Remove last newline
  • comm -12 <(echo 1; echo 2) <(echo 1; echo 2; echo 3) — Shows intersection (here 1 2).
  • cat template.txt | envsubst — substitutes environment variables in file
  • echo 123abc | od -c -t d1 — Show decimal dump
  • echo 123abc | xxd — Show a hexdump (or do the reverse)