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
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
#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
/* Includes ------------------------------------------------------------------*/ | |
#include <stdio.h> | |
#include "STM32F4xx.h" | |
/* Private variables ---------------------------------------------------------*/ | |
struct __FILE { int handle; }; | |
FILE __stdout; | |
FILE __stdin; | |
/* Private functions ---------------------------------------------------------*/ |
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
//Includes | |
#include <stdio.h> | |
#include <stdlib.h> // EXIT_xxxxx | |
#include <string.h> //memset | |
#include <unistd.h> //close | |
#include <sys/socket.h> | |
#include <sys/types.h> | |
#include <arpa/inet.h> | |
//SNTP RFC > https://tools.ietf.org/html/rfc4330 |
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> | |
int map(int value, int fromStart, int fromEnd, int toStart, int toEnd) { | |
return (value - fromStart) * (toEnd - toStart) / (fromEnd - fromStart) + toStart; | |
} | |
int main(void) { | |
int x = map(50, 0, 100, 0, 255); | |
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 "xc.h" | |
#include "config.h" | |
#define _XTAL_FREQ 8000000 | |
/* Variables */ | |
unsigned int i; | |
void setDuty(unsigned int duty) { | |
CCPR1L = duty >> 2; |
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 "xc.h" | |
#include "config.h" | |
#define BUFSIZE 12 //Maximum size of received string | |
volatile unsigned char rx_data; | |
volatile unsigned char rx_index; | |
volatile unsigned char rx_buffer[BUFSIZE]; | |
/** |
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 $(GNUSTEP_MAKEFILES)/common.make | |
# make a simple program in Objective-C | |
TOOL_NAME = App | |
# The implementation Objective-C file which is going to be compiled | |
App_OBJC_FILES = main.m | |
# Header files of your project | |
#App_HEADER_FILES = xxx.h | |
# Define compilation flags | |
ADDITIONAL_CPPFLAGS = -Wall -Wno-import | |
# Include rules for creating a command line tool for Objective-C |
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 <Foundation/Foundation.h> | |
int main (void) { | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
NSLog(@"Hello World!\n"); | |
[pool release]; | |
return 0; | |
} |
OlderNewer