Skip to content

Instantly share code, notes, and snippets.

View qqwx00's full-sized avatar
🌴
On vacation

qqwx qqwx00

🌴
On vacation
View GitHub Profile
@qqwx00
qqwx00 / jinja2_file_less.py
Created March 15, 2022 05:43 — forked from wrunk/jinja2_file_less.py
python jinja2 examples
#!/usr/bin/env/python
#
# More of a reference of using jinaj2 without actual template files.
# This is great for a simple output transformation to standard out.
#
# Of course you will need to "sudo pip install jinja2" first!
#
# I like to refer to the following to remember how to use jinja2 :)
# http://jinja.pocoo.org/docs/templates/
#
<!-- AWS Region: US East (Northern Virginia) -->
<add ipAddress="72.44.32.0" subnetMask="255.255.224.0" allowed="true" />
<add ipAddress="67.202.0.0" subnetMask="255.255.192.0" allowed="true" />
<add ipAddress="75.101.128.0" subnetMask="255.255.128.0" allowed="true" />
<add ipAddress="174.129.0.0" subnetMask="255.255.0.0" allowed="true" />
<add ipAddress="204.236.192.0" subnetMask="255.255.192.0" allowed="true" />
<add ipAddress="184.73.0.0" subnetMask="255.255.0.0" allowed="true" />
<add ipAddress="184.72.128.0" subnetMask="255.255.128.0" allowed="true" />
<add ipAddress="184.72.64.0" subnetMask="255.255.192.0" allowed="true" />
<add ipAddress="50.16.0.0" subnetMask="255.254.0.0" allowed="true" />
package main
import (
"context"
"flag"
"math/rand"
crand "crypto/rand"
"os"
"time"
"log"
@qqwx00
qqwx00 / atoi_test.go
Created February 27, 2019 07:02 — forked from evalphobia/atoi_test.go
golang benchmark: String and Int conversions
package bench
import (
"strconv"
"testing"
)
var smallStr = "35"
var bigStr = "999999999999999"
@qqwx00
qqwx00 / join_test.go
Created February 27, 2019 06:51 — forked from dtjm/join_test.go
strings.Join vs fmt.Sprintf vs string concat (+)
package join
import (
"fmt"
"strings"
"testing"
)
var (
testData = []string{"a", "b", "c", "d", "e"}
@qqwx00
qqwx00 / cgo.md
Created February 15, 2019 08:49 — forked from zchee/cgo.md
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.

@qqwx00
qqwx00 / ChildComponent.vue
Created August 7, 2017 08:26 — forked from sproogen/ChildComponent.vue
Vee Validate - Child Component Example
<template>
<div>
<input v-validate data-rules="required" :class="{'has-error': errors.has("textInput")}" id="textInput" name="textInput" type="text">
<span class="error" v-show="errors.has("textInput")">{{ errors.first("textInput") }}</span>
</div>
</template>
<script>
import { find, propEq } from 'ramda'
import bus from './bus'