Skip to content

Instantly share code, notes, and snippets.

View nvkv's full-sized avatar
:shipit:
What's happening indeed?!

Semyon Novikov nvkv

:shipit:
What's happening indeed?!
View GitHub Profile
λ ./run-ml-web.sh
Symbol <CFUNCTION load nRequired: 1 hasRest: #f> already exists and it's not objc function, skipping
Symbol <CFUNCTION load nRequired: 1 hasRest: #f> already exists and it's not objc function, skipping
Symbol <CFUNCTION sqrt nRequired: 1 hasRest: #f> already exists and it's not objc function, skipping
Symbol <CFUNCTION abs nRequired: 1 hasRest: #f> already exists and it's not objc function, skipping
Symbol <CFUNCTION abs nRequired: 1 hasRest: #f> already exists and it's not objc function, skipping
Warning: redefining global function /= to <MACRO /=>
Warning: redefining global special lambda to <MACRO lambda>
Warning: redefining global special = to <MACRO =>
Warning: redefining global function not-nil? to <COMPILED-FUNCTION not-nil?>
def parse
result, utf8 = [], Iconv.new("UTF-8", "UTF-16")
@parsing_string = utf8.iconv(@parsing_string)
# Get all comments (including multiline)
comments = @parsing_string.scan /\*((?:.|[\r\n])*?)\*/
# Get all key-value pairs
pairs = @parsing_string.scan /\"(.*)\" = \"(.*)\"/
comments.each_with_index do |comment, index|
#!/bin/zsh
killall Mail
BEFORE=`ls -lah ~/Library/Mail | grep -E 'Envelope Index$' | awk '{ print $5 }'`
sqlite3 ~/Library/Mail/'Envelope Index' vacuum
AFTER=`ls -lah ~/Library/Mail | grep -E 'Envelope Index$' | awk '{ print $5}'`
echo "before: $BEFORE"
echo "after: $AFTER"
#pragma mark Runtime stuff
- (void) collectTestClasses
{
int classesCount = 0;
Class * c_list = NULL;
c_list = NULL;
classesCount = objc_getClassList(NULL, 0);
@nvkv
nvkv / uncrustify.cfg
Created May 4, 2011 09:08
Nulana's Uncrustify config for Objective-C/C++
indent_align_string=false
indent_braces=false
indent_braces_no_func=false
indent_brace_parent=false
indent_namespace=false
indent_extern=false
indent_class=false
indent_class_colon=false
indent_else_if=false
indent_func_call_param=false
@nvkv
nvkv / gist:1042911
Created June 23, 2011 16:26
Working branch extraction for my zsh theme
function git_prompt_info() {
branch=`(git branch | grep '*' | awk '{print $2}') 2> /dev/null`
if [ -z $branch ]; then
return
fi
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$branch$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
@nvkv
nvkv / gist:1048344
Created June 27, 2011 05:17
AWESOME isintnumber()
char ystring :: isintnumber()
{
char c=true;
int i=0;
if ( (this->symbols[i]=='-') ||
(this->symbols[i]=='0') ||
(this->symbols[i]=='1') ||
(this->symbols[i]=='2') ||
(this->symbols[i]=='3') ||
(this->symbols[i]=='4') ||
@nvkv
nvkv / gist:1254020
Created September 30, 2011 15:06
CouchDB update validate function
function(newDoc, oldDoc, userCtx) {
if (userCtx.name != "admin") {
throw({forbidden : 'Нет пути!'});
}
}
@nvkv
nvkv / json.rb
Created December 14, 2011 10:09
Very simple and dirty json CLI query tool
#!/usr/bin/env ruby
# Very simple and dirty json CLI query tool
require 'rubygems'
require 'json'
def numeric?(s)
Float(s) rescue false
end