Skip to content

Instantly share code, notes, and snippets.

View janisblaus's full-sized avatar

Jānis Blaus janisblaus

  • Latvia, Riga
View GitHub Profile
const { exec } = require('child_process');
const desiredArgument = 'your_argument';
exec(`wmic process where "CommandLine like '%%%${desiredArgument}%%%' and not CommandLine like '%%wmic%%'" get ProcessId`, (error, stdout) => {
if (error) {
console.error(`Error: ${error.message}`);
return;
}
@janisblaus
janisblaus / gist:fd13210dc2d61bf53e432010ce37c329
Created February 25, 2021 20:25
Fix Grub ♥ on OVH nvme disks, software RAID | Centos
mount /dev/md2 /mnt
mount /dev/nvme0n1p1 /mnt/boot/efi
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt
grub2-mkconfig -o /boot/grub2/grub.cfg
grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg
var identifier = itor.get_request_identifier();
itor.on_request_identifier_change(changeIdentifier);
function changeIdentifier() {
identifier = itor.get_request_identifier();
}
switch(response){
case 'process-finished':
/ Process finished successfully. /
identifier
$(".ui-autocomplete-city").autocomplete({
source: function(request, response){
$.ajax({
url: "http://ws.geonames.org/searchJSON",
dataType: "jsonp",
data: {
featureClass: "P",
style: "full",
maxRows: 12,
name_startsWith: request.term,
$(".ui-autocomplete-city").autocomplete({
source: function(request, response){
$.ajax({
url: "http://ws.geonames.org/searchJSON",
dataType: "jsonp",
data: {
featureClass: "P",
style: "full",
maxRows: 12,
name_startsWith: request.term,
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-37679953-1', 'auto');
ga('send', 'pageview');
</script>
<style>
.panel-right .navigation .button{
font-size: 15px;
}
.panel-left .input .title{
font-size:12px;
}
@janisblaus
janisblaus / GA
Created November 30, 2014 14:25
analītika kriliem
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-57216292-1', 'auto');
ga('send', 'pageview');
</script>
@janisblaus
janisblaus / ProfileController.php
Created November 28, 2014 19:58
Piemērs kā iegūt adreses informāciju
public function postPostcode()
{
$address = Input::get('address');
$url = "http://maps.googleapis.com/maps/api/geocode/json?address=".urlencode($address)."&sensor=false";
$response = file_get_contents($url);
return $response;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Notepad++</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>