This file contains hidden or 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
| function solution(A) { | |
| var cars0 = 0, | |
| cars1 = 0, | |
| combinations = 0; | |
| for (var i = A.length - 1; i >= 0; i--) { | |
| if (A[i] === 0) { | |
This file contains hidden or 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
| function solution(N, A) { | |
| var counters = new Uint32Array(N), | |
| max = 0, | |
| gMax = 0; | |
| for (i = 0; i < A.length; i++) { | |
| var value = A[i]; | |
This file contains hidden or 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
| <article class="socialmediaicons"> | |
| <span class="title"> Join the movement: </span> | |
| <ul class="group"> | |
| <% appdata.social.forEach(function(item) { %> | |
| <li> | |
| <a href="<%= item.url %>"> | |
| <img class="icon" src="<%= item.imageURL %>" alt="icon for <%= item.shortname %>" />" | |
| </a> | |
| </li> | |
| <% }); %> |
This file contains hidden or 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
| GCClient *apiClient = [GCClient sharedClient]; | |
| [apiClient setAuthorizationHeaderWithToken:@"YOUR_TOKEN"]; | |
| [GCServiceAlbum getAlbumWithID:@(YOUR_ALBUM_ID) success:^(GCResponseStatus *responseStatus, GCAlbum *album) { | |
| [album importAssetsFromURLs:@[@"YOUR_VIDEO_URL"] success:^(GCResponseStatus *responseStatus, NSArray *assets, GCPagination *pagination) { | |
| /* | |
| Imported the asset, do something. | |
| */ |
This file contains hidden or 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 System.Directory | |
| import Control.Monad (filterM, mapM, liftM) | |
| import System.FilePath ((</>)) | |
| getDirsRec :: FilePath -> IO [FilePath] | |
| getDirsRec d = do | |
| dirContents <- getDirectoryContents d | |
| let dirContents' = [ d </> x | x <- dirContents, x /= ".", x /= ".." ] | |
| dirs' <- mapM dirRec dirContents' | |
| return (concat dirs' ++ [d]) |
This file contains hidden or 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 http = require('http'); | |
| var url = require('url'); | |
| var crypto = require('crypto'); | |
| var AESCrypt = {}; | |
| AESCrypt.decrypt = function(cryptkey, iv, encryptdata) { | |
| encryptdata = new Buffer(encryptdata, 'base64').toString('binary'); | |
| var decipher = crypto.createDecipheriv('aes-128-cbc', cryptkey, iv), | |
| decoded = decipher.update(encryptdata, 'binary', 'utf8'); |
This file contains hidden or 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 crypto = require('crypto'); | |
| var AESCrypt = {}; | |
| AESCrypt.decrypt = function(cryptkey, iv, encryptdata) { | |
| encryptdata = new Buffer(encryptdata, 'base64').toString('binary'); | |
| var decipher = crypto.createDecipheriv('aes-128-cbc', cryptkey, iv), | |
| decoded = decipher.update(encryptdata); |
This file contains hidden or 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 http = require('http'); | |
| var url = require('url'); | |
| var activeState = "0"; | |
| var reqCounter = 0; | |
| var server = http.createServer(function (req, res) { | |
| console.log("____________________________"); | |
| console.log("URL:", decodeURIComponent(req.url)); |
This file contains hidden or 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
| @interface NSManagedObject (Serialization) | |
| - (NSDictionary*) toDictionary; | |
| - (void) populateFromDictionary:(NSDictionary*)dict; | |
| + (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict | |
| inContext:(NSManagedObjectContext*)context; | |
| @end |