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
package main | |
import ( | |
"fmt" | |
"strconv" | |
) | |
func UJoin(list []uint64, sep string) string { | |
length := len(list) |
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
Raw configuration: | |
[section] ; comment type of ; ? | |
item = 1 ; comment 2 | |
arr = 1, 4, 5 | |
str = "hey" | |
str2 = 'hey' | |
float = 1.10 | |
[[second section]] # comment type of # ? |
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
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { | |
t := time.Now() | |
loc, err := time.LoadLocation("Asia/Jerusalem") |
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
require 'openssl' | |
require 'base64' | |
root_key = OpenSSL::PKey::RSA.new 2048 # the CA's public/private key | |
root_ca = OpenSSL::X509::Certificate.new | |
root_ca.version = 2 # cf. RFC 5280 - to make it a "v3" certificate | |
root_ca.serial = 1 | |
root_ca.subject = OpenSSL::X509::Name.parse "/DC=org/DC=ruby-lang/CN=Ruby CA" | |
root_ca.issuer = root_ca.subject # root CA's are "self-signed" | |
root_ca.public_key = root_key.public_key |
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
#include <stdio.h> | |
#include <string.h> | |
int empty_string(char * str) { | |
return(str == NULL || strlen(str) == 0 ); | |
} | |
int main(int argc, char **argv) { | |
char * ch = NULL; |
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
puts $1 if str =~ /([a-fA-F\d]{8}(-[a-fA-F\d]{4}){3}-[a-fA-F\d]{12}?)/ |
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
{ | |
"key1": "string", | |
"key2": true, | |
"key3": 10, | |
"nested": { | |
"nested_key1": [1] | |
} | |
} |
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
package main | |
// http://play.golang.org/p/jZ5pa944O1 <- will not display the colors | |
import "fmt" | |
const ( | |
InfoColor = "\033[1;34m%s\033[0m" | |
NoticeColor = "\033[1;36m%s\033[0m" | |
WarningColor = "\033[1;33m%s\033[0m" | |
ErrorColor = "\033[1;31m%s\033[0m" | |
DebugColor = "\033[0;36m%s\033[0m" |
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
package main | |
import "fmt" | |
import "unicode/utf16" | |
import "unicode/utf8" | |
import "bytes" | |
func main() { | |
b := []byte{ |
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
package main | |
import ( | |
"fmt" | |
"regexp" | |
"strings" | |
) | |
var utf8GsmChars = map[string]string{ | |
`@`: "\x00", `£`: "\x01", `$`: "\x02", |