Skip to content

Instantly share code, notes, and snippets.

View itbj's full-sized avatar
🌴
On vacation

taoza itbj

🌴
On vacation
View GitHub Profile
@MichalZalecki
MichalZalecki / Dockerfile
Last active January 25, 2023 23:23
Install oh-my-zsh in Docker
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "zsh"]
RUN wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh || true
# docker exec -it my-app-container /bin/zsh
@labnol
labnol / index.html
Created April 30, 2014 13:27
Google Maps
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d56790.47490202523!2d78.042155!3d27.175014999999924!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x39747121d702ff6d%3A0xdd2ae4803f767dde!2sTaj+Mahal!5e0!3m2!1sen!2s!4v1398864446719" width="800" height="600" frameborder="0" style="border:0"></iframe>
@yuuichi-fujioka
yuuichi-fujioka / install_start_stop_daemon.sh
Created June 7, 2014 15:11
install start-stop-daemon to centos, fedora, redhat.
#!/bin/bash
cd /usr/local/src
wget http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
tar zxvf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
cd apps/sys-utils/start-stop-daemon-IR1_9_18-2
gcc start-stop-daemon.c -o start-stop-daemon
cp start-stop-daemon /usr/sbin/
@prati0100
prati0100 / robbyrussell.zsh-theme
Created May 27, 2019 12:43
Change color of prompt of robbyrussell zsh theme to yellow if root
local ret_status="%(?:%{$fg_bold[green]%}➜ :%{$fg_bold[red]%}➜ )"
# PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} '
# Change color of prompt to yellow if root
PROMPT='${ret_status} %{%(#~$fg[yellow]~$fg[cyan])%}%c%{$reset_color%} '
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[blue]%}git:(%{$fg[red]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})"
@iest
iest / README.md
Last active August 11, 2022 09:20
Setting up environment variables with various shells

What the hell are environment variables?

They're just variables you set on your system that various programs/processes can read. A fairly standard example in javascript circles would be setting your NODE_ENV variable to "production" or "development", altering how node code is executed on your system (for example showing more debug messaging when in development).

With most shells there's a way to set them for the current session, and a way to set them for all sessions. The following is meant to be a guide on how to set env vars in the various shells.

Bash (The default shell on OSX)

Setting for the session:

@maxivak
maxivak / _readme.md
Last active June 8, 2022 06:19
Vagrant with Ubuntu 16.04 in VirtualBox

Setup Ubuntu 16.04 to be used with Vagrant and Virtualbox

Prepare Vagrant box with Ubuntu 16.04

We will use official box "ubuntu/xenial64" and modify it to work with Vagrant.

  • Vagrantfile
#main.py
from fastapi import FastAPI,Body, Depends
import schemas
import models
from database import Base, engine, SessionLocal
from sqlalchemy.orm import Session
#This will create our database if it doesent already exists
Base.metadata.create_all(engine)
def get_session():
session = SessionLocal()
@fleeto
fleeto / gist:9912971
Last active April 8, 2022 17:39
Drupal黑话入门

Drupal可能会让初学者深感畏惧。对大多数人来说,第一只拦路虎就是Drupal世界中一系列的术语,这些术语有的很生僻,有的在不同语境中有着不同的含义。要尽快的融入Drupal社区,同其他的Drupal爱好者沟通,最好能尽快的理解和使用Drupal的这些词汇。这里列出一些常用的Drupal术语。

Block - (这里保持原文,因常用的汉语翻译区块很容易和下句话中的区域混淆——译者注) Block用于将一小片内容摆放到页面的指定区域(例如左侧边栏,头部或底部等),例如一个包含了公司联系信息的Block可以放置到所有页面底部。或者将一个包含了相关商品的Block展示在一个目录下所有商品的详情页中。

Core - 也就是核心,指的是在Drupal.org下载的标准Drupal包中包含的缺省功能。这些功能包含Menu(Menu实际上和我们软件行业常说的菜单有很大区别,指的不是菜单,而是Drupal的Url系统——译者注)管理,用户管理,系统管理,设计和布局,以及分类系统等等。

Contrib - 是Drupal社区成员将一些新增的或变更的功能,以主题和模块的形式进行发布。这些模块和主题可以从 https://drupal.org/download 进行下载。

d.o - dropal.org的简称。发音为dee dot oh。

@maxtacu
maxtacu / countertimer.py
Last active February 12, 2022 14:28
Python countdown timer https://youtu.be/9QSo3F6sM1w
import time
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-t', '--time', type=int, required=True, help="Time in seconds")
parser.add_argument('-o', '--output',default="counter.txt", help="Output file")
args = parser.parse_args()
def countdown(t):
while t:
""""Create "The Matrix" of binary numbers scrolling vertically in your terminal.
original code adapted from juancarlospaco:
- http://ubuntuforums.org/showpost.php?p=10306676
Inspired by the movie: The Matrix
- Corey Goldberg (2013)
Requires: