Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ujifgc
ujifgc / vmg2xml.rb
Last active February 22, 2024 13:14
This tiny script converts SMS text message backup from VMG to XML. Formats are tested on transferring Kies bada backup to Android SMS Backup & Restore.
require 'cgi'
class String
def extract( token )
self.scan( /#{token}:(.*)/ ).flatten.first
end
end
puts "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>\n<smses>\n"
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@mikepruett3
mikepruett3 / mycygwininst.cmd
Last active February 26, 2023 01:42
Batch Script (cmd) to Download and Install the appropriate version of Cygwin with custom packages!!!
:: Name: mycygwininst.cmd
:: Purpose: Downloads and Installs Cygwin with custom packages
:: Author: mikepruett3@gmail.com
:: Revision: 20161106 - initial version
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
SET _script=%~n0
SET _parentdir=%~dp0
@k16shikano
k16shikano / replace-char.tex
Last active March 30, 2022 12:01
platexで文字の置換をexpl3でやる
% platexで文字の置換 https://ja.stackoverflow.com/questions/53898/platex%E3%81%A7%E6%96%87%E5%AD%97%E3%81%AE%E7%BD%AE%E6%8F%9B をexpl3でやってみる。
% おそらくenvironの制限で、この書き方だとinstead環境のネストには対応していない。
% xparseの新しい引数指定オプションbを使うと環境の本体がとれて、これだとうまくいくかもしれない。
\documentclass[uplatex]{jsarticle}
\usepackage{xparse}
\usepackage{environ}
\ExplSyntaxOn
@kou1okada
kou1okada / cygwin_autoinstall.bat
Last active July 20, 2021 13:55
Cygwin automatic installer
@ECHO OFF
REM Cygwin automatic installer
REM Copyright (c) 2013-2015 Koichi OKADA. All rights reserved.
REM This script is distributed under the MIT license.
REM http://www.opensource.org/licenses/mit-license.php
SETLOCAL
CD %~dp0
@KINGSABRI
KINGSABRI / dlls.rb
Created August 2, 2016 19:09 — forked from tetsuyainfra/dlls.rb
Windows の Ruby が開いてる dll の一覧を見る@fiddle版
require "fiddle/import"
require 'fiddle/types'
# オリジナル(Win32APIライブラリを使う版)はこちら
# https://rubyist.g.hatena.ne.jp/edvakf/20110405/1301973681
module WIN32API
extend Fiddle::Importer
dlload 'C:\\Windows\\System32\\kernel32.dll'
include Fiddle::Win32Types
extern 'DWORD GetCurrentProcessId()'
@1d10t
1d10t / contacts2.db-to-vcf.php
Created May 27, 2017 00:53
android contacts2.db to vcard file (vcf) converter
<?php
ini_set('mbstring.language', 'Russian');
function db(){
static $db = null;
if(!$db){
$db = new SQLite3(__DIR__.'/contacts2.db');
$db->busyTimeout(60*60*1000);
@Furao
Furao / gitlab_process.md
Created June 4, 2014 16:47
DO-178C gitlab process

Use Case: I need to add some new requirements.

  • Create a new branch and add all of my requirements
  • Make a pull request to master
  • All of the new requirements are easily shown in the gitlab pull request
  • Reviewers would add their comments in gitlab to specific lines.
  • Developers would be able to comment back and forth in the comment section of the pull request and then make fixes
  • Reviewers can then verify once a fix has been made (Add a new comment to the line saying it is fixed?)
  • All changes have been accepted so the branch is merged into master
@bfoz
bfoz / Makefile
Created February 15, 2010 11:56
Compile and link a bootloader using SDCC
ASM= asx8051
CC= sdcc
BOOTLOADER_ADDRESS=0x3000
OUTPUT_DIR= build
.PHONY: $(OUTPUT_DIR)
.SUFFIXES:
.SUFFIXES: .asm .c .ihx .hex .rel
@phillipadsmith
phillipadsmith / mod_rewrite_rules
Created November 22, 2011 21:12
Mobile site redirection using mod_rewrite
RewriteEngine On
# If the user is asking for the fullsite, set a cookie, remove the query, and stop.
RewriteCond %{QUERY_STRING} ^fullsite$
RewriteRule ^/?(.*)$ http://domain.com/$1? [L,CO=fullsite:yes:.domain.com]
# If the user is asking for the mobilesite, set a cookie, remove the query, redirect and stop.
RewriteCond %{QUERY_STRING} ^mobilesite$
RewriteRule ^/?(.*)$ http://m.domain.com/$1? [L,CO=fullsite:no:.domain.com]