Skip to content

Instantly share code, notes, and snippets.

Avatar

Vladimir Parfinenko cypok

View GitHub Profile
@AntonLydike
AntonLydike / risc-v.tex
Last active Nov 11, 2022
RISC-V Assembler lstlisting syntax and style
View risc-v.tex
% 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 Mar 19, 2015
whichpkg: who installed this command?
View whichpkg.sh
# 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 Nov 3, 2014
How effectively delete a git submodule.
View delete_git_submodule.md

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 Jul 1, 2014
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.
View gettext_update.sh
#!/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 --msgid-bugs-address=noreply@example.com -o base.pot -f files.txt
# base pot -> <lang>.po update
@erikh
erikh / hack.sh
Created Mar 31, 2012 — forked from DAddYE/hack.sh
OSX For Hackers
View hack.sh
#!/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 Jul 1, 2021
Script to visualize your expenses and assets using Ledger
View ledger_graph.rb
#!/usr/bin/env ruby
# encoding: utf-8
require 'date'
def bad_usage
puts "Usage: ledger_graph <output.svg> month_expenses <limit> [<year> <month>]"
puts " or: ledger_graph <output.svg> last_assets <months>"
exit
end
View Xcode324iOS41TestSuiteWorkaround.m
//
// 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.
//
View .irbrc.rb
# Put this to ~/.irbrc (no extension)
require "rubygems"
require 'irb/completion'
ARGV.concat [ "--readline", "--prompt-mode", "simple" ]
# IRB & Readline hostory
module Readline
module History