Skip to content

Instantly share code, notes, and snippets.

View jacobbubu's full-sized avatar

Rong Shen jacobbubu

  • Li Auto.
  • Beijing, China
View GitHub Profile
@jacobbubu
jacobbubu / root_certs.txt
Created May 23, 2013 09:54
root certificates list for iOS and node.js
iOS:
http://support.apple.com/kb/HT5012?viewlocale=en_US&locale=en_US
node.js:
https://github.com/joyent/node/blob/master/src/node_root_certs.h
localOffset = (new Date).getTimezoneOffset() * 60000
getLocaleStringByTimezoneOffset = (date, offset) ->
localTime = date.getTime()
utc = localTime + localOffset
offsetDate = utc + 3600000 * offset
nd = (new Date(offsetDate))
nd.toLocaleDateString() + ' ' + nd.toLocaleTimeString()
d = new Date()
@jacobbubu
jacobbubu / gist:5408997
Last active October 10, 2017 20:55
Regular Expression for UTC time offsets validation
^([+]((14|(14[:]?00))|([0][0-9]|[1][01])|([0][0-9]|[1][01])[:]?[0-5][0-9]))|([-]((12|(12[:]?00))|([0][0-9]|[1][01])|([0][0-9]|[1][01])[:]?[0-5][0-9]))$
The offset from UTC is given in the format ±[hh]:[mm], ±[hh][mm], or ±[hh], for exsamples:
Reference to http://en.wikipedia.org/wiki/Zone.tab.
+14:00
+1200
+12
-11:59
-01
@jacobbubu
jacobbubu / configPart.coffee
Last active December 16, 2015 00:49
Alternative WebSocket implementation for ActionHero using
# RFC Web Socket Server
# You must have the web server enabled as well
configData.rfcWebSocket =
mount: "/ws"
@jacobbubu
jacobbubu / ioslocaleidentifiers.csv
Created February 15, 2012 14:41
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@jacobbubu
jacobbubu / ISOCurrencySymbols.csv
Created February 15, 2012 14:31
iOS Currency Symbols
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
ADP ADP
AED AED
AFA AFA
AFN Af
ALK ALK
ALL ALL
AMD AMD
ANG NAf.
AOA Kz
AOK AOK
@jacobbubu
jacobbubu / ISOLanguageCodes.csv
Created February 15, 2012 14:30
iOS Language Codes
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
aa Afar
ab Abkhazian
ace Achinese
ach Acoli
ada Adangme
ady Adyghe
ae Avestan
af Afrikaans
afa Afro-Asiatic Language
afh Afrihili
@jacobbubu
jacobbubu / ISOCurrencyCodes.csv
Created February 15, 2012 14:28
iOS Currency Codes
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
ADP Andorran Peseta
AED United Arab Emirates Dirham
AFA Afghan Afghani (1927-2002)
AFN Afghan Afghani
ALK Albanian Lek (1946-1965)
ALL Albanian Lek
AMD Armenian Dram
ANG Netherlands Antillean Guilder
AOA Angolan Kwanza
AOK Angolan Kwanza (1977-1991)
@jacobbubu
jacobbubu / ISOCountryCodes.csv
Created February 15, 2012 14:26
iOS Country Codes
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
AD Andorra
AE United Arab Emirates
AF Afghanistan
AG Antigua and Barbuda
AI Anguilla
AL Albania
AM Armenia
AN Netherlands Antilles
AO Angola
AQ Antarctica