Skip to content

Instantly share code, notes, and snippets.

@chongkan
chongkan / constants
Created July 21, 2023 11:24 — forked from adrianhajdin/constants
Build and Deploy a Web3 Crowdfunding Platform (Kickstarter) As Your First Blockchain Application
import { createCampaign, dashboard, logout, payment, profile, withdraw } from '../assets';
export const navlinks = [
{
name: 'dashboard',
imgUrl: dashboard,
link: '/',
},
{
name: 'campaign',
@chongkan
chongkan / install-pre-commit.sh
Created December 8, 2016 20:12 — forked from stefansundin/install-pre-commit.sh
Git pre-commit check to stop accidental commits to master and develop branches. There is also a variant with a core.whitespace check.
#!/bin/sh
# This script will install a Git pre-commit hook that stop accidental commits to master and develop branches.
# There is also a variant that includes a core.whitespace check. See pre-commit-2 below.
# Install in current Git repo:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh
# Install with core.whitespace check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-2
# Install with core.whitespace check and EOF-newline-check:
# curl -fL https://gist.githubusercontent.com/stefansundin/9059706/raw/install-pre-commit.sh | sh -s pre-commit-3
# Install only core.whitespace check:
@chongkan
chongkan / Elasticsearch install script
Created October 1, 2015 19:16 — forked from ThomasArdal/Elasticsearch install script
Script to setup Elasticsearch on Linux
#!/usr/bin/env bash
# update apt
sudo apt-get update
# install java
sudo apt-get install openjdk-7-jre-headless -y
# install elasticsearch
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb
@chongkan
chongkan / etchosts.sh
Last active August 29, 2015 14:20 — forked from mikeflynn/etchosts.sh
#!/bin/bash
HOSTSFILE="/etc/hosts"
BAKFILE="$HOSTSFILE.bak"
DOMAINREGEX="^[a-zA-Z0-9]{1}[a-zA-Z0-9\.\-]+$"
IPREGEX="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
URLREGEX="^https?:\/\/[a-zA-Z0-9]{1}[a-zA-Z0-9\/\.\-]+$"
backup()
{