Skip to content

Instantly share code, notes, and snippets.

@har07
har07 / readme.md
Created April 15, 2021 06:43
Referensi JWT Python
@har07
har07 / script.sh
Created October 14, 2020 03:08
Ubuntu listen to sound from microphone
# listen to microphone
pactl load-module module-loopback latency_msec=1
# stop listening
pactl unload-module module-loopback
@har07
har07 / zsh.md
Created June 27, 2020 03:00 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu

This is simple example showing how to add auto-complete for your custom javascript object i.e context. Open Monaco Editor Playground and paste snippet above into the right panel. Hit run and type context. in the right panel: auto-complete with list of context's fields should appear

func filterGridParamsPostgre(params *query.GridParams) (state bool, fullQuery string, fullSorter string) {
var values []string
var query string
var sign string
var complementArg string
var connector string
var queries string
var fullQueries []string
var argument string
func (h *PolicyHandler) listUsersGrid(c echo.Context) error {
tenant := c.Param("tenant")
id := c.Param("id")
gridParams := c.Get("gridParams").(*query.GridParams)
policy, err := h.PolicyStorage.GetPolicy(tenant, id)
if err != nil {
return response.JSONError(c, http.StatusBadRequest, err)
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@har07
har07 / BaseViewModel.cs
Last active February 24, 2023 17:16
Xamarin.Form : Binding item's IsVisible according to ListView selection
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Runtime.CompilerServices;
namespace BasicListView
{
public class BaseViewModel : INotifyPropertyChanged
{
@har07
har07 / SO_36865920.py
Last active April 26, 2016 13:18
lxml.html get table header elements
from lxml import html
raw = '''<table class="list">
<tr>
<th>Date(s)</th>
<th>Sport</th>
<th>Event</th>
<th>Location</th>
</tr>
<tr>
xml = """<Create>
<SubNetwork networkType="GSM" userLabel="BSC">
</SubNetwork>
<SubNetwork networkType="WCDMA" userLabel="RNC01">
</SubNetwork>
<SubNetwork networkType="IPRAN" userLabel="IPRAN">
</SubNetwork>