Skip to content

Instantly share code, notes, and snippets.

var crc16ituTable = [...]uint16{
0x0000, 0x1189, 0x2312, 0x329B, 0x4624, 0x57AD, 0x6536, 0x74BF,
0x8C48, 0x9DC1, 0xAF5A, 0xBED3, 0xCA6C, 0xDBE5, 0xE97E, 0xF8F7,
0x1081, 0x0108, 0x3393, 0x221A, 0x56A5, 0x472C, 0x75B7, 0x643E,
0x9CC9, 0x8D40, 0xBFDB, 0xAE52, 0xDAED, 0xCB64, 0xF9FF, 0xE876,
0x2102, 0x308B, 0x0210, 0x1399, 0x6726, 0x76AF, 0x4434, 0x55BD,
0xAD4A, 0xBCC3, 0x8E58, 0x9FD1, 0xEB6E, 0xFAE7, 0xC87C, 0xD9F5,
0x3183, 0x200A, 0x1291, 0x0318, 0x77A7, 0x662E, 0x54B5, 0x453C,
0xBDCB, 0xAC42, 0x9ED9, 0x8F50, 0xFBEF, 0xEA66, 0xD8FD, 0xC974,
0x4204, 0x538D, 0x6116, 0x709F, 0x0420, 0x15A9, 0x2732, 0x36BB,
class NewsScreen extends StatefulWidget {
@override
State<StatefulWidget> createState() => _NewsScreenState();
}
class _NewsScreenState extends State<NewsScreen> {
final List<String> listItems = [];
final List<String> _tabs = <String>[
"Featured",
@iRbouh
iRbouh / unlipage.js
Created October 28, 2016 20:26
unlipage.js
function loophalaman(a){var e="";nomerkiri=parseInt(numshowpage/2),nomerkiri==numshowpage-nomerkiri&&(numshowpage=2*nomerkiri+1),mulai=nomerhal-nomerkiri,mulai<1&&(mulai=1),maksimal=parseInt(a/postperpage)+1,maksimal-1==a/postperpage&&(maksimal-=1),akhir=mulai+numshowpage-1,akhir>maksimal&&(akhir=maksimal),e+="<span class='showpageOf'>Page "+nomerhal+" of "+maksimal+"</span>";var s=parseInt(nomerhal)-1;nomerhal>1&&(e+=2==nomerhal?"page"==jenis?'<span class="showpage"><a href="'+home_page+'">'+upPageWord+"</a></span>":'<span class="showpageNum"><a href="/search/label/'+lblname1+"?&max-results="+postperpage+'">'+upPageWord+"</a></span>":"page"==jenis?'<span class="showpageNum"><a href="#" onclick="redirectpage('+s+');return false">'+upPageWord+"</a></span>":'<span class="showpageNum"><a href="#" onclick="redirectlabel('+s+');return false">'+upPageWord+"</a></span>"),mulai>1&&(e+="page"==jenis?'<span class="showpageNum"><a href="'+home_page+'">1</a></span>':'<span class="showpageNum"><a href="/search/label/'+lbl
@iRbouh
iRbouh / secure-JSON.json
Created July 21, 2016 22:57
Secure JSON
)]}',
{"status":"success","message":"cookies and session are successfully invalidated","url":"http://localhost.xxx.com"}
@iRbouh
iRbouh / json-ld-dynamic-markup.html
Last active April 8, 2022 21:11
JSON-LD Dynamic Markup
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<script type="text/javascript">
var el = document.createElement('script');
@iRbouh
iRbouh / sample-data.json
Last active July 5, 2016 03:03
Sample JSON data
{
"records":[
{
"index":1,
"index_start_at":56,
"integer":11,
"float":18.276,
"name":"Maureen",
"surname":"Hill",
"fullname":"Harry Singleton",
@iRbouh
iRbouh / jsonlite.js
Created July 4, 2016 01:49
Jsonlite is a variant of json, aims for human readability and writability by http://deerchao.net/
//Written by http://deerchao.net/
var jsonlite;
(function (jsonlite) {
function parse(source, jsonObjectFormat) {
if (typeof jsonObjectFormat === "undefined") { jsonObjectFormat = true; }
var object_start = jsonObjectFormat ? '{' : '(';
var object_end = jsonObjectFormat ? '}' : ')';
var pair_seperator = jsonObjectFormat ? ':' : ':';
var at = 0;
@iRbouh
iRbouh / UseAutoIncrementID.php
Last active December 20, 2022 02:26
Auto incrementing sequence Trait to use with jenssegers/laravel-mongodb for AI MySQL-like IDs
<?php
namespace App\Traits;
trait UseAutoIncrementID {
/**
* Increment the counter and get the next sequence
*
* @param $collection