Skip to content

Instantly share code, notes, and snippets.

View Xsmael's full-sized avatar
😎
Be serious, but not too serious

Ismael O. Xsmael

😎
Be serious, but not too serious
  • SharpEdge
  • 127.0.0.1
View GitHub Profile
@Xsmael
Xsmael / uid-generator.js
Last active February 12, 2019 21:58
Simple guaranteed unique, fast enough, not too long, id generator in JavaScript
//Guaranted unique fast enough id generator in JavaScript
function getUID() {
return Math.random().toString(36).substring(2, 15)
+'-'+Math.random().toString(36).substring(2, 15)
+'-'+Date.now().toString(36);
}
// inspired from https://stackoverflow.com/a/13403498/2429678
@Xsmael
Xsmael / gist:af33f51ade9b2a53928da4cd137a7515
Created October 12, 2018 12:47
Count the total number of lines of xls exel files in directory
var fs= require("fs");
var node_xj = require("xls-to-json");
var totalLines= 0;
fs.readdir('./FTA', function (err, files) {
files.forEach((file,idx) => {
console.log(file);
node_xj({
input: './FTA/'+file, // input xls
output: null // output json
print("ok")
a= 5
b=10
print(a+b)
x <- 4L
20 -> y
print(class(x))
print(class(y))
<script>
var a = [[1.0,1.0,1.0], [0.5,0.5,0.5], [0.0,0.5,0.0]];
var b = [[1.0,0.5,1.0], [0.0,1.0,0.0], [0.5,0.0,0.0]];
var c = [[1.0,0.0,0.0], [0.5,1.0,0.5], [0.0,0.0,1.0]];
var items= [];
items[0]= a;
items[1]= b;
items[2]= c;
@Xsmael
Xsmael / lang-codes.json
Created August 31, 2017 21:23
Language codes
[
{"code":"ab","name":"Abkhaz","nativeName":"аҧсуа"},
{"code":"aa","name":"Afar","nativeName":"Afaraf"},
{"code":"af","name":"Afrikaans","nativeName":"Afrikaans"},
{"code":"ak","name":"Akan","nativeName":"Akan"},
{"code":"sq","name":"Albanian","nativeName":"Shqip"},
{"code":"am","name":"Amharic","nativeName":"አማርኛ"},
{"code":"ar","name":"Arabic","nativeName":"العربية"},
{"code":"an","name":"Aragonese","nativeName":"Aragonés"},
{"code":"hy","name":"Armenian","nativeName":"Հայերեն"},
@Xsmael
Xsmael / wpa_supplicant.conf
Created August 20, 2017 19:23 — forked from fheinle/wpa_supplicant.conf
wpa supplicant sample
ctrl_interface=/var/run/wpa-supplicant
ap_scan=1
network={
ssid="HIER_NETZWERK_NAMEN_EINTRAGEN"
scan_ssid=1
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
group=TKMP
psk="HIERDASKENNWORTEINTRAGEN"
@Xsmael
Xsmael / temporary-email-address-domains
Created June 21, 2017 16:47 — forked from adamloving/temporary-email-address-domains
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
@Xsmael
Xsmael / Javascript ISO country code to country name conversion
Created February 9, 2017 19:12 — forked from maephisto/Javascript ISO country code to country name conversion
ISO 3166-1 alpha-2 country code to country name conversion with a simple Javascript implementation, an array and a function.
var isoCountries = {
'AF' : 'Afghanistan',
'AX' : 'Aland Islands',
'AL' : 'Albania',
'DZ' : 'Algeria',
'AS' : 'American Samoa',
'AD' : 'Andorra',
'AO' : 'Angola',
'AI' : 'Anguilla',
'AQ' : 'Antarctica',