Download flutter
tar xvf flutter_linux_1.17.5-stable.tar.xz
Download flutter
tar xvf flutter_linux_1.17.5-stable.tar.xz
| # remove sheet protection in Excel | |
| # Sample file: https://www.dropbox.com/s/4ul0kowrscyr8cz/excel_protected.xlsx?dl=0 | |
| library(stringr) | |
| library(zip) | |
| # file with protected sheets | |
| file <- "data/excel_protected.xlsx" | |
| # file name and path after removing protection |
| var paths = [ | |
| ["Account"], | |
| ["Account", "Payment Methods"], | |
| ["Account", "Payment Methods", "Credit Card"], | |
| ["Account", "Payment Methods", "Paypal"], | |
| ["Account", "Emails"], | |
| ["Account", "Emails", "Main Email"], | |
| ["Account", "Emails", "Backup Email"], | |
| ["Account", "Devices"], | |
| ["Account", "Devices", "Google Pixel"], |
| if ('serviceWorker' in navigator) { | |
| caches.keys().then(function(cacheNames) { | |
| cacheNames.forEach(function(cacheName) { | |
| caches.delete(cacheName); | |
| }); | |
| }); | |
| } |
| // browser | |
| console.log('%c Fucking hell! ', 'background: #222; font-size: 42px; color: #ff0000'); | |
| // nodejs | |
| console.log('\x1b[36m%s\x1b[0m', info); //cyan | |
| console.log('\x1b[33m%s\x1b[0m: ', path); //yellow | |
| //Here is reference of colors and other characters: | |
| Reset = "\x1b[0m" | |
| Bright = "\x1b[1m" |
| // Using this code, we can retrieve an image from a user's filesystem, resize the image, and then upload the image | |
| // to a server using AJAX. Because we use base64 encoding, we can just include the image data as just another string value | |
| // in a JSON payload. | |
| // So we can use AJAX to send the file to a server, which is convenient. | |
| // We have one line of relevant html | |
| // get file in the first place => <input type="file" custom-on-change="onAcqImageFileChange" class="form-control"> |
| (function($) { | |
| $.getStylesheet = function (href) { | |
| var $d = $.Deferred(); | |
| var $link = $('<link/>', { | |
| rel: 'stylesheet', | |
| type: 'text/css', | |
| href: href | |
| }).appendTo('head'); | |
| $d.resolve($link); | |
| return $d.promise(); |
| <?php | |
| $prefLocales = array_reduce( | |
| explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']), | |
| function ($res, $el) { | |
| list($l, $q) = array_merge(explode(';q=', $el), [1]); | |
| $res[$l] = (float) $q; | |
| return $res; | |
| }, []); | |
| arsort($prefLocales); |
adapted from this blog
# YAML
name: Jon# YAML
object:| <?php | |
| function progress_bar($done, $total, $info="", $width=50) { | |
| $perc = round(($done * 100) / $total); | |
| $bar = round(($width * $perc) / 100); | |
| return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info); | |
| } |