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
export const bibleNumberOfVerseByChapter = [ | |
[ | |
31, | |
25, | |
24, | |
26, | |
32, | |
22, | |
24, | |
22, |
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
// httpHelper에 아래와 같이 정의하고 | |
const corsRoutine = (req, res, func) => { | |
cors(req, res, () => { | |
func(req, res); | |
}); | |
} | |
// functions 구현할 때 corsRoutine으로 감싸서 쓰고 있습니다. |
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
'use strict' | |
// solution from https://stackoverflow.com/questions/49701000/how-to-do-unit-testing-in-react-native-that-uses-firebase | |
export class Database { | |
ref = (path) => { | |
if (!this[path]) { | |
this[path] = new Reference(path) | |
} | |
return this[path] | |
} |
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
jest.mock('react-native-firebase', () => { | |
return { | |
messaging: jest.fn(() => { | |
return { | |
hasPermission: jest.fn(() => Promise.resolve(true)), | |
subscribeToTopic: jest.fn(), | |
unsubscribeFromTopic: jest.fn(), | |
requestPermission: jest.fn(() => Promise.resolve(true)), | |
getToken: jest.fn(() => Promise.resolve('myMockToken')) | |
}; |
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 updateCollection(db, collectionRef, newData, batchSize) { | |
// console.log('updateCollection') | |
var query = collectionRef.orderBy('__name__').limit(batchSize); | |
return new Promise(function(resolve, reject) { | |
updateQueryBatch(db, query, batchSize, newData, resolve, reject); | |
}); | |
} | |
function updateQueryBatch(db, query, batchSize, newData, resolve, reject) { |
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
shouldComponentUpdate(nextProps, nextState){ | |
console.log("component should update") | |
if(nextProps.status === POST_STATUS.POST_STATUS_SAVED) { | |
this._closePost() | |
} | |
return true | |
} | |
const mapStateToProps = (state, props) => { |
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
ESC ! n | |
[Name] Select print mode(s) | |
[Format] | |
ASCII ESC ! n | |
Hex 1B 21 n | |
Decimal 27 33 n | |
[Range] 0≤n≤255 | |
[Description] Selects print mode(s) using n as follows: |
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
- (IBAction)printHelloWorld:(id)sender { | |
NSString * str = @"Hello World\n\r"; | |
NSString *command = @"1B2100"; | |
NSMutableData *commandToSend= [[NSMutableData alloc] init]; | |
unsigned char whole_byte; | |
char byte_chars[3] = {'\0','\0','\0'}; | |
int 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
- (IBAction)printHelloWorld:(id)sender { | |
NSString * str = @"Hello World\n\r"; | |
NSData* data = [str dataUsingEncoding:NSUTF8StringEncoding]; | |
[self.printerPeripheral writeValue:data forCharacteristic:self.writeCharacteristic type:CBCharacteristicWriteWithoutResponse]; | |
} |
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
#!/usr/bin/ruby | |
require 'fileutils' | |
require 'zip' | |
def unzip | |
Zip::File.open(ARGV[0]) { |zipfile| | |
zipfile.each {|f| | |
# cp949 파일 이름을 utf-8로 변환 | |
utf_string = f.name.force_encoding("CP949").encode("UTF-8", :invalid => :replace, :undef => :replace, :replace => "_") # for ruby1.9 or higher | |
FileUtils.mkdir_p(File.dirname(utf_string)) |
NewerOlder