Skip to content

Instantly share code, notes, and snippets.

@ahmpro
ahmpro / habr.htm
Last active August 29, 2015 14:07
Хабрахабр — профилактика
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Хабрахабр / Профилактические работы</title>
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport">
<style>
@font-face {
font-family: 'PT Sans';
font-style: normal;
@sharipov-ru
sharipov-ru / bootstrap.markdown
Last active December 14, 2015 10:59
collection of useful bootstrap links

Twitter Bootstrap Useful Links

fastlane_version "1.33.0"
default_platform :ios
platform :ios do
before_all do
cocoapods
ENV['KEYCHAIN_NAME'] = "TempKeychain.keychain"
end
@jverkoey
jverkoey / Tuple+Generator.swift
Last active February 3, 2018 22:59
Tuple enumeration
/** The returned generator will enumerate each value of the provided tuple. */
func generatorForTuple(tuple: Any) -> AnyGenerator<Any> {
return anyGenerator(Mirror(reflecting: tuple).children.lazy.map { $0.value }.generate())
}
// Blogged at http://design.featherless.software/enumerating-tuple-values-swift/
<?php
$token = ''; // access_token
$antigate_key = ''; // http://antigate.com/panel.php?action=showkey
$online = api('account.setOnline', 'access_token='.$token); // Продлеваем online на 15 минут
if(isset($online["error"]["captcha_img"])) {
$img_captcha = $online["error"]["captcha_img"];
$captcha_sid = $online["error"]["captcha_sid"];
$antigate_response = antigate($antigate_key, $img_captcha);
//var_dump($antigate_response);
@alexbosworth
alexbosworth / KeychainService.swift
Last active January 5, 2021 08:26
Swift Keychain Class
import UIKit
import Security
let serviceIdentifier = "com.company"
let accessGroup = "com.company.app"
let kSecClassValue = kSecClass as NSString
let kSecAttrAccountValue = kSecAttrAccount as NSString
let kSecValueDataValue = kSecValueData as NSString
let kSecClassGenericPasswordValue = kSecClassGenericPassword as NSString
@axiixc
axiixc / AXMutableOrderedDictionary.h
Created April 29, 2011 18:06
A mutable ordered dictionary collection for Objective-C.
@interface AXMutableOrderedDictionary : NSMutableDictionary <NSMutableCopying> {
@private
NSMutableArray * _keys;
NSMutableDictionary * _dict;
}
+ (id)newWithCapacity:(NSUInteger)initialCapacity;
+ (id)newWithOrderedDictionary:(AXMutableOrderedDictionary *)otherDictionary;
+ (id)newWithObjects:(NSArray *)objects forKeys:(NSArray *)keys;
@julesjans
julesjans / screen-gif.sh
Last active May 8, 2021 16:40
Capture iOS Simulator to animated gif
# Turn on the simulator screen capture
xcrun simctl io booted recordVideo ~/simulator.mov
# Convert the iPhone 6s screen shot into a gif:
ffmpeg -i ~/simulator.mov -vf scale=320:-1 -r 6 -f gif -y simulator.gif
Project # of Top 100 Free Apps (US)
facebook-ios-sdk 67
Bolts-iOS 48
AFNetworking 39
Google-Mobile-Ads-SDK 38
Reachability (Apple) 38
Crashlytics 37
Flurry-iOS-SDK 31
CocoaPods 30
GoogleConversionTracking 29
@victor-homyakov
victor-homyakov / detect-unused-css-selectors.js
Last active February 17, 2023 18:36
Detect unused CSS selectors. Show possible CSS duplicates. Monitor realtime CSS usage.
/* eslint-disable no-var,no-console */
// detect unused CSS selectors
(function() {
var parsedRules = parseCssRules();
console.log('Parsed CSS rules:', parsedRules);
detectDuplicateSelectors(parsedRules);
var selectorsToTrack = getSelectorsToTrack(parsedRules);
window.selectorStats = { unused: [], added: [], removed: [] };
console.log('Tracking style usage (inspect window.selectorStats for details)...');