Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am developernotes on github.
  • I am developernotes (https://keybase.io/developernotes) on keybase.
  • I have a public key ASDbxgC82b6__XQnmV46r9yEeibCm7rIHJjf0w44lqASTgo

To claim this, I am signing this object:

@developernotes
developernotes / brew-list-dependencies.rb
Created April 30, 2015 15:18
List installed homebrew packages and their dependencies
require 'utils'
class ListDependencies
def run
@command = <<-EOT
brew list | while read cask; do
printf "\e[1;34m%s ->\e[1;37m" "$cask";
brew deps $cask | awk '{printf(" %s ", $0)}'; echo "";
done

Keybase proof

I hereby claim:

  • I am developernotes on github.
  • I am developernotes (https://keybase.io/developernotes) on keybase.
  • I have a public key whose fingerprint is 61DE BD73 2F3F 0777 1269 972E 2F87 3048 08D4 0CEC

To claim this, I am signing this object:

@developernotes
developernotes / SampleTest.java
Created November 13, 2013 23:13
Sample test for opening a SQLCipher 3.0.0 database for the SQLCipher mailing list.
package net.zetetic.tests;
import android.util.Log;
import net.sqlcipher.Cursor;
import net.sqlcipher.database.SQLiteDatabase;
import net.zetetic.ZeteticApplication;
import java.io.File;
import java.io.IOException;
(defun string-replace (old-value new-value source)
"replace old-value with new-value from source"
(with-temp-buffer
(insert source)
(goto-char (point-min))
(while (search-forward old-value nil t)
(replace-match new-value nil t))
(buffer-substring (point-min) (point-max))))
(defun org-export-to-csv (file)
@developernotes
developernotes / DemoViewController.cs
Created April 4, 2013 16:43
Full text search example with SQLCipher for Xamarin.iOS
using System;
using System.Drawing;
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using System.IO;
using Mono.Data.Sqlcipher;
namespace Demo
["1", "2", "3", "4", "5"].map(function(x, y, z){return parseInt(x)})
@developernotes
developernotes / sqlcipher.php
Created November 21, 2012 22:01
Dump the SQLCipher version in PHP
<?php
try {
$db = new SQLite3("demo.db");
$version = $db->query("PRAGMA cipher_version");
if($version){
var_dump($version->fetchArray());
} else {
throw new Exception($db->lastErrorMsg());
}
@developernotes
developernotes / gist:3723995
Created September 14, 2012 19:03
OracleDataReader ctor
// Oracle.DataAccess.Client.OracleDataReader
private IntPtr m_pColumnsDataBuffer = IntPtr.Zero;
private object m_disposeSyncObj = new object();
internal unsafe OracleDataReader(OracleConnection connection, IntPtr[] opsSqlCtx, IntPtr opsDacCtx, IntPtr opsErrCtx, OpoSqlValCtx* pOpoSqlValCtx, OpoDacValCtx* pOpoDacValCtx, MetaData metaData, int resultCount, CommandBehavior commandBehavior, Hashtable safeMapping, string commandText, int freeOpsSqlCtx, bool bFetchSizePropertySet)
{
int num = 0;
this.m_bBOF = true;
this.m_external = true;
this.m_safeMapping = safeMapping;
this.m_bFetchSizePropertySet = bFetchSizePropertySet;
@developernotes
developernotes / changelog.sh
Created July 5, 2012 20:45
Display a simple changelog between the last two tags in a Git repository
#! /usr/bin/env sh
firstTag=$(git tag | sort -r | head -1)
secondTag=$(git tag | sort -r | head -2 | awk '{split($0, tags, "\n")} END {print tags[1]}')
echo "Changes between ${secondTag} and ${firstTag}\n"
git log --pretty=format:' * %s' ${secondTag}..${firstTag}