Skip to content

Instantly share code, notes, and snippets.

View nenadvulic's full-sized avatar

Nenad VULIC nenadvulic

  • KeepOnApps
  • Paris
View GitHub Profile
#EXTM3U
#EXT-X-VERSION:1
## Created with Unified Streaming Platform(version=1.7.25)
#EXT-X-SESSION-KEY:METHOD=SAMPLE-AES,URI="skd://fps.ezdrm.com/;c3bf9ab5-b008-44f4-bc71-7290a2d4bcb7",KEYFORMAT="com.apple.streamingkeydelivery",KEYFORMATVERSIONS="1"
#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID="subs",NAME="English",DEFAULT=NO,FORCED=NO,URI="https://vodstorage.arte.tv/movies/VTT/100521/HLS_100521_0-VO-RETR.vtt",LANGUAGE="en"
# variants
#EXT-X-STREAM-INF:BANDWIDTH=342000,CODECS="mp4a.40.2,avc1.66.30",RESOLUTION=426x240,SUBTITLES="subs"
HLS_154251_0-VOF-fairplay-audio=64038-video=258000.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=694000,CODECS="mp4a.40.2,avc1.66.30",RESOLUTION=640x360,SUBTITLES="subs"
otal 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local object.
remote: /data/github/releases/deploy-b/vendor/gems/2.4.2/ruby/2.4.0/gems/statsd-ruby-0.3.0.github.3.38.gd478cc7/lib/github/statsd.rb:23:in `ip': getaddrinfo: Name or service not known (SocketError)
remote: from /data/github/releases/deploy-b/vendor/gems/2.4.2/ruby/2.4.0/gems/statsd-ruby-0.3.0.github.3.38.gd478cc7/lib/github/statsd.rb:23:in `initialize'
remote: from /data/github/releases/deploy-b/vendor/gems/2.4.2/ruby/2.4.0/gems/statsd-ruby-0.3.0.github.3.38.gd478cc7/lib/github/statsd.rb:106:in `new'
remote: from /data/github/releases/deploy-b/vendor/gems/2.4.2/ruby/2.4.0/gems/statsd-ruby-0.3.0.github.3.38.gd478cc7/lib/github/statsd.rb:106:in `add_shard'
remote: from /data/github/releases/deploy-b/lib/github/config/stats.rb:33:in `block in create_statsd'
remote: from /data/github/releases/deploy-b/lib/github/config/stats.rb:33:in `each'
remote: from /data/github/releases/deploy-b/lib/github/config/s
@nenadvulic
nenadvulic / hmacsha1
Last active February 22, 2017 09:53
SHA1 in Swift 3
func hmacsha1(_ data:Data!, secret key:Data!) -> Data! {
let cHMAC = UnsafeMutablePointer<CUnsignedChar>.allocate(capacity:Int(CC_SHA1_DIGEST_LENGTH))
key.withUnsafeBytes {(keyBytes: UnsafePointer<UInt8>)->Void in
data.withUnsafeBytes {(dataBytes: UnsafePointer<UInt8>)->Void in
CCHmac(CCHmacAlgorithm(kCCHmacAlgSHA1),keyBytes, key.count, dataBytes, data.count, cHMAC)
}
}
return Data(bytes:cHMAC, count:Int(CC_SHA1_DIGEST_LENGTH))
}
{
"car": {
"card_id": "tok_18NKXeIQ1hNzz4uNU7L4rTHC",
"car_id": 1,
"end_date": "2016-06-23 09:16:00",
"start_date": "2016-06-22 09:16:00",
"location": 1
}
}
This file has been truncated, but you can view the full file.
POST /api/v1/memos/19/assets HTTP/1.1
Host: api-staging.memoriz.io
Content-Type: application/x-www-form-urlencoded
Connection: keep-alive
Accept: */*
User-Agent: memoriz/4 CFNetwork/758.3.15 Darwin/15.4.0
Accept-Language: en-us
Content-Length: 760361
Accept-Encoding: gzip, deflate
POST /api/v1/memos HTTP/1.1
Host: api-staging.memoriz.io
Content-Type: application/vnd.api+json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Accept: application/vnd.api+json
User-Agent: memoriz/0.1 (iPhone; iOS 9.2; Scale/2.00)
Accept-Language: fr,en
Authorization: Bearer f3c35000a4c0318a3c50f6d04161b8a995e94aab7d2de1d9b74e11b169fffba3
Content-Length: 320
POST /api/v1/memos HTTP/1.1
Host: api-staging.memoriz.io
Content-Type: application/vnd.api+json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Accept: application/vnd.api+json
User-Agent: memoriz/0.1 (iPhone; iOS 9.2; Scale/2.00)
Accept-Language: fr,en
Authorization: Bearer 1ad8bb6890a6c72b67400172af6c18ad4229c6d158a2a3809475531b0a2a451b
Content-Length: 242
@nenadvulic
nenadvulic / UICollectionViewFlowLayout.m
Created March 3, 2016 10:56
UICollectionView snap cell vertically
- (CGPoint)targetContentOffsetForProposedContentOffset:(CGPoint)proposedContentOffset withScrollingVelocity:(CGPoint)velocity {
CGPoint contentOffset = CGPointZero;
NSInteger itemHeight = 130;
NSInteger padding = 10;
NSInteger index = round(proposedContentOffset.y / (itemHeight + padding));
NSInteger x = (itemHeight + padding) * index;
contentOffset = CGPointMake(proposedContentOffset.x, x);
return contentOffset;
@nenadvulic
nenadvulic / gist:39a52a0116d501114b50
Created June 17, 2014 02:15
TC - apply.tcdisrupt.com/api/saveApp.cfm
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:197):197
<br><span style='margin-right: 1em;'>&nbsp;</span> a
t com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1493):1493
<br><span style='margin-right: 1em;'>&nbsp;</span>
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:390):390
<br><span style='margin-right: 1em;'>&nbsp;</span> at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:340):340<
br><span style='margin-right: 1em;'>&nbsp;</span> at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575):4575<
br><span style='margin-right: 1em;'>&nbsp;</span> at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400):1400<
br><span style='margin-right: 1em;'>&nbsp;</span> at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQL
@nenadvulic
nenadvulic / StubbViewController
Last active August 29, 2015 13:57
Fake network data using with OHHTTPStubs.
#import "MyViewController.h"
#import <OHHTTPStubs/OHHTTPStubs.h>
@interface FLUSubscribeViewController(){
id<OHHTTPStubsDescriptor> _stub;
}
@end
@implementation FLUSubscribeViewController