Skip to content

Instantly share code, notes, and snippets.

View windwp's full-sized avatar
💭
I may be slow to respond.

windwp

💭
I may be slow to respond.
  • VietNam
View GitHub Profile
@windwp
windwp / i3-swallow-restore.py
Created June 11, 2020 10:03
update i3 swallow
#!/usr/bin/env python3
#-----------------------------------------------
# used to swallow a terminal window in i3
#
# INSTALL
# Install python 3 and install i3ipc libary
# pip3 install i3ipc
# download this scrript and put it to your i3 config folder and run
# chmod +x $HOME/.config/i3/i3-swallow.py
@windwp
windwp / i3-swallow.py
Last active January 4, 2023 11:27
i3-swallow used to swallow a terminal window in i3
#!/usr/bin/env python3
#-----------------------------------------------
# used to swallow a terminal window in i3
#
# INSTALL
# Install python 3 and install i3ipc libary
# pip3 install i3ipc
# download this scrript and put it to your i3 config folder and run
$margin-list: 0 2 5 10 15 20;
@each $mg in $margin-list {
.mx-#{$mg} {
margin-left: #{$mg}px !important;
margin-right: #{$mg}px !important;
}
.my-#{$mg} {
margin-top: #{$mg}px !important;
import 'package:flutter/material.dart';
class GoodListScreen extends StatefulWidget {
static const routeName = 'GoodListScreen';
GoodListScreen({Key key}) : super(key: key);
_GoodListState createState() => _GoodListState();
}
class _GoodListState extends State<GoodListScreen> {
@windwp
windwp / enum typescript.ts
Created June 1, 2018 03:54
typescript snipplet
export namespace Data11 {
export type PlatformEnum = 'android' | 'ios' | 'windows';
export const PlatformEnum = {
Android: 'android' as PlatformEnum,
Ios: 'ios' as PlatformEnum,
Windows: 'windows' as PlatformEnum
}
}
@windwp
windwp / preload-nolazy.ts
Created May 31, 2018 06:13
preload image angular directive
import { Directive, ElementRef, Input } from '@angular/core';
@Directive({
selector: '[preloadImage]'
})
export class PreloadImage {
private _sourceImage: string;
private _errorImage: string;
private
@Input('preloadImage') set sourceImage(url: string) {
@windwp
windwp / style.css
Created March 15, 2018 03:09
css collection
.center-block {
display: flex;
align-items: center;
}
##Run IIS in folder
"C:\PROGRA~2\IISEXP~1\IISEXP~1.EXE" /path:"F:\workspace\project\web\ShopAdmin\ShopAdmin\ShopAdmin.Web" /port:9090 /clr:v4.0
// truy van 1 truong nao` do' boi? deepPopulate
.deepPopulate('user.business',{populate:{'user' :{select:'displayName profileImageURL business'},'user.business': { select: 'url'}}})
//truy van 1 thanh phan nao` do' trong 1 mang
if( req.query.suburb){
searchQuery.suburbs = {$elemMatch: {name: req.query.suburb, enabled: true}};
}
//disable angular xeditable disable-permission-xedit="permission"
angular.module("pmt").directive("disablePermissionXedit", function(UserService) {
function compile(el, attr) {
if (!UserService.hasPermissionBool(attr.disablePermissionXedit)) {
var hasDirective = el[0].querySelectorAll("[editable-text]");
[].forEach.call(hasDirective, function(el) {
el.removeAttribute('editable-text');
});
hasDirective = el[0].querySelectorAll("[editable-select]");
[].forEach.call(hasDirective, function(el) {