Skip to content

Instantly share code, notes, and snippets.

@AntonLydike
AntonLydike / risc-v.tex
Last active November 6, 2024 10:33
RISC-V Assembler lstlisting syntax and style
% RISC-V Assembler syntax and style for latex lstlisting package
%
% These are risc-v commands as per our university (University Augsburg, Germany) guidelines.
%
% Author: Anton Lydike
%
% This code is in the public domain and free of licensing
% language definition
\lstdefinelanguage[RISC-V]{Assembler}
@NIA
NIA / whichpkg.sh
Created March 19, 2015 09:50
whichpkg: who installed this command?
# whichpkg: which package installed this command?
# Detects builtins and follows symlinks. Add the code below to .bashrc/.bash_aliases
# Usage examples:
#
# nia$ whichpkg vim
# vim-gtk: /usr/bin/vim.gtk
#
# nia$ whichpkg type
# type встроена в оболочку
#
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@raspi
raspi / gettext_update.sh
Created July 1, 2014 17:03
Shell script for updating Gettext .po files in a PHP project. Create new languages simply by copying base.pot to <language code>.po. For example: cp base.pot fi.po. Then just edit fi.po with poedit or some other editor.
#!/bin/bash -e
# generate file list
echo -e "" > files.txt
find ../application -type f \( -iname "*.php" -or -iname "*.phtml" \) -exec readlink -f "{}" \; > files.txt
# scan files
xgettext --force-po --add-comments --from-code=UTF-8 --language=php --package-name=app --package-version=1.0 [email protected] -o base.pot -f files.txt
# base pot -> <lang>.po update
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@cypok
cypok / ledger_graph.rb
Last active June 1, 2024 19:36
Script to visualize your expenses and assets using Ledger
# moved to https://github.com/cypok/ledger_graph
//
// Xcode324iOS41TestSuiteWorkaround.m
//
// This source file provides a work-around to enable running unit tests
// against the iPhone Simulator in Xcode 3.2.4 with iOS SDK 4.1.
//
// This work-around is only needed when using Xcode 3.2.4 to target iOS 4.1.
//
// Copyright 2010 Apple Inc. All rights reserved.
//
# Put this to ~/.irbrc (no extension)
require "rubygems"
require 'irb/completion'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
# IRB & Readline hostory
module Readline
module History