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
#include <stdio.h> | |
#define ITM_Port8(n) (*((volatile unsigned char *)(0xE0000000+4*n))) | |
#define ITM_Port16(n) (*((volatile unsigned short*)(0xE0000000+4*n))) | |
#define ITM_Port32(n) (*((volatile unsigned long *)(0xE0000000+4*n))) | |
#define DEMCR (*((volatile unsigned long *)(0xE000EDFC))) | |
#define TRCENA 0x01000000 | |
struct __FILE { int handle; /* Add whatever is needed */ }; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace Core.Extensions | |
{ | |
public static class ListExtension | |
{ | |
public static IEnumerable<IEnumerable<T>> Split<T>(this List<T> list, int size) | |
{ |
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
crypto = require('crypto'); | |
//Iterations | |
iterations = 100; | |
//Length | |
length = 32; | |
/* | |
Generate the salt |
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 array = ["email", "password", "username"]; | |
var search = ["email", "password"]; | |
console.log(_.every(search, _.partial(_.contains, array))); | |
//true |
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
exports.convertHrTimeToMs = (hrtime) => | |
diff = process.hrtime(hrtime) | |
return parseInt((diff[0] * 1e9 + diff[1]) * 1e-6) |
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
//Hash of data | |
data = { | |
longitude : 1, | |
latitude : 1 | |
}; | |
//Required keys | |
var requiredKeys = ['longitude', 'latitude']; | |
//Return true |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
namespace Stack | |
{ | |
[Serializable] | |
public class LimitedStack<T> : IEnumerable | |
{ | |
#region Fields |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
namespace List.Extensions | |
{ | |
public static class ListExtension | |
{ | |
public static Object GetOneRandom<T>(this IEnumerable<T> list) | |
{ |
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
using System; | |
using System.Collections.Generic; | |
namespace Range | |
{ | |
public class ProportionValue<T> | |
{ | |
public double Proportion { get; set; } | |
public T Value { get; set; } | |
} |
NewerOlder