Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
import React, { Component } from "react"; | |
import { ActivityIndicator, View } from "react-native"; | |
import {StyleSheet} from 'react-native' | |
const styles = StyleSheet.create({ | |
loading: { | |
flex: 1, | |
flexDirection: "row", | |
alignItems: 'center' | |
}, |
const getQueryString = params => { | |
return Object.keys(params) | |
.map(k => { | |
if (Array.isArray(params[k])) { | |
return params[k] | |
.map(val => `${encodeURIComponent(k)}[]=${encodeURIComponent(val)}`) | |
.join("&"); | |
} | |
return `${encodeURIComponent(k)}=${encodeURIComponent(params[k])}`; |
function elementInViewport2(el) { | |
var top = el.offsetTop; | |
var left = el.offsetLeft; | |
var width = el.offsetWidth; | |
var height = el.offsetHeight; | |
while(el.offsetParent) { | |
el = el.offsetParent; | |
top += el.offsetTop; | |
left += el.offsetLeft; |
# -*- coding: utf-8 -*- | |
import wifi | |
def Search(): | |
wifilist = [] | |
cells = wifi.Cell.all('wlan0') |
#!/usr/bin/env python | |
import argparse | |
import redis | |
def connect_redis(conn_dict): | |
conn = redis.StrictRedis(host=conn_dict['host'], | |
port=conn_dict['port'], | |
db=conn_dict['db']) | |
return conn |
Helper setup to edit .yaml files with Vim:
List of general purpose commands for Kubernetes management:
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/gin-gonic/gin" | |
) | |
type CreateParams struct { |
import glob, os | |
import pathlib | |
from django.apps import apps | |
from django.db.models.fields.related import OneToOneField, ForeignKey | |
from collections import OrderedDict | |
from django.template import Template, Context | |
from django.db import connection | |
def execute_raw_sql(query): |
cd ~/project/payslip-visualisation/ | |
branch="$(git name-rev --name-only HEAD)" | |
git checkout $branch | |
git pull origin $branch | |
source ~/.virtualenvs/finklim/bin/activate | |
pip install -r requirements.txt | |
python manage.py migrate | |
python manage.py collectstatic --no-input | |
sudo supervisorctl restart all |
client = boto3.client( | |
'cognito-idp', region_name="ap-southeast-1", | |
**{ | |
'aws_access_key_id': "", | |
'aws_secret_access_key': "" | |
}) |