This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Copyright (c) 2013 Anisimov Nikita <ravis.bmstu at gmail dot com> | |
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
#documentation files (the "Software"), to deal in the Software without restriction, including without limitation | |
#the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and | |
#to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of | |
#the Software. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Copyright (c) 2013 Anisimov Nikita | |
#Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | |
#documentation files (the "Software"), to deal in the Software without restriction, including without limitation | |
#the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and | |
#to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
#The above copyright notice and this permission notice shall be included in all copies or substantial portions of | |
#the Software. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)appNameAndVersionNumberDisplayString { | |
NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; | |
NSString *appDisplayName = [infoDictionary objectForKey:@"CFBundleDisplayName"]; | |
NSString *majorVersion = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; | |
NSString *minorVersion = [infoDictionary objectForKey:@"CFBundleVersion"]; | |
return [NSString stringWithFormat:@"%@, Version %@ (%@)", | |
appDisplayName, majorVersion, minorVersion]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[_webView stringByEvaluatingJavaScriptFromString: | |
[NSString stringWithFormat:@"var result = '';" | |
"var viewport = null;" | |
"var content = null;" | |
"var document_head = document.getElementsByTagName( 'head' )[0];" | |
"var child = document_head.firstChild;" | |
"while ( child )" | |
"{" | |
" if ( null == viewport && child.nodeType == 1 && child.nodeName == 'META' && child.getAttribute( 'name' ) == 'viewport' )" | |
" {" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UILabel+Visible.h | |
// Gisting | |
// | |
// Created by Anisimov Nikita on 14.08.14. | |
// Copyright (c) 2014 Anisimov Nikita. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var symbols = '23456789QWERTYUPASDFGHJKZXCVBNM'; | |
var qty = 2500000; | |
var length = 7; | |
var code, hash, i, maxIndex, rand, symbol, _i, _j; | |
maxIndex = symbols.length - 1; | |
for (i = _i = 1; 1 <= qty ? _i <= qty : _i >= qty; i = 1 <= qty ? ++_i : --_i) { | |
code = ''; | |
hash = 0; | |
for (symbol = _j = 1; 1 <= length ? _j <= length : _j >= length; symbol = 1 <= length ? ++_j : --_j) { | |
rand = Math.floor((Math.random() * maxIndex) + 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
myAwesomeApp | |
|-client | |
| |-lib #Only Client libraries | |
| |-js | |
| |-templates | |
|-collections #Define, Publish & Subscribe collections | |
|-lib #Isomorphic (Client + Server) libraries | |
|-private #files & folders avaliable via http | |
| |-css | |
| |-other |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git ls-files | xargs wc -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# import it like this: | |
# import app_logging as logging | |
import logging | |
from logging import * | |
GENERIC_LVL_NAME = "GENERIC" #Thats our new mixed-in level | |
GENERIC_LVL = 100 | |
logging.basicConfig( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thyme is a time tracking utility -- https://github.com/sourcegraph/thyme | |
thyme_up() { | |
pushd ~/thyme | |
if [ -f thyme_pid ]; | |
then | |
THYMEPID=$(cat thyme_pid) | |
if ps -p $THYMEPID > /dev/null | |
then | |
echo "thyme pid file exists and process is UP" | |
else |