Skip to content

Instantly share code, notes, and snippets.

@zeqk
zeqk / datepicker.cshtml
Created October 31, 2019 15:28 — forked from badcommandorfilename/datepicker.cshtml
C# HTML5 input date datepicker MVC Razor
<!-- How to insert a date editor in a Razor view -->
<div class="form-group">
@Html.LabelFor(model => model.Start, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.TextBoxFor(model => model.Start, new { @type="date", @class = "form-control datepicker", @Value = Model.Start.ToString("yyyy-MM-dd") } )
@Html.ValidationMessageFor(model => model.Start, "", new { @class = "text-danger" })
</div>
</div>
@zeqk
zeqk / git-overwrite-branch.sh
Created December 30, 2019 21:28 — forked from ummahusla/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of seotweaks branch (seotweaks > master)
git checkout seotweaks # source name
git merge -s ours master # target name
git checkout master # target name
git merge seotweaks # source name
@zeqk
zeqk / index.html
Created February 3, 2020 23:59 — forked from maxkostinevich/index.html
Cloudflare Worker - Handle Contact Form
<!--
/*
* Serverless contact form handler for Cloudflare Workers.
* Emails are sent via Mailgun.
*
* Learn more at https://maxkostinevich.com/blog/serverless-contact-form
* Live demo: https://codesandbox.io/s/serverless-contact-form-example-x0neb
*
* (c) Max Kostinevich / https://maxkostinevich.com
*/
@zeqk
zeqk / delete_git_submodule.md
Created May 12, 2020 21:55 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@zeqk
zeqk / group_vars
Created August 14, 2020 19:06 — forked from charypar/group_vars
Deploying SSL keys securely with Ansible (code)
---
ssl_certificates:
- certificate_src: secure.example.com.pem
certificate_dest: /etc/ssl/certs/secure.example.com.pem
key_src: secure.example.com.protected.key
key_dest: /etc/ssl/private/secure.example.com.protected.key
key_stripped: /etc/ssl/private/secure_example.com.key
key_password: "{{ssl_passphrase}}"
@zeqk
zeqk / xmlhttp-example.asp
Created October 13, 2020 19:32
Classic ASP xmlhttp example
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><!DOCTYPE html>
<%
'----------
' This is an example of an old script I used to use to pull data from an internal web server
' and render it on a public-facing website.
'----------
Function getBBstatus()
Dim xmlhttp
Set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.setTimeouts 30,500,1000,1000
@zeqk
zeqk / remove_gitlab_artifacts.sh
Created March 6, 2021 03:38 — forked from carceneaux/remove_gitlab_artifacts.sh
Script for removing GitLab Job Artifacts.
#!/bin/bash
#
# Written by Chris Arceneaux
# GitHub: https://github.com/carceneaux
# Email: [email protected]
# Website: http://arsano.ninja
#
# Note: This code is a stop-gap to erase Job Artifacts for a project. I HIGHLY recommend you leverage
# "artifacts:expire_in" in your .gitlab-ci.yml
#
@zeqk
zeqk / README.md
Created June 10, 2021 20:02 — forked from thomaslarsen/README.md
Convert PEM certificate to JSON format
@zeqk
zeqk / docker-compose-node-mongo.yml
Created September 17, 2021 19:00 — forked from wesleybliss/docker-compose-node-mongo.yml
Docker Compose with example App & Mongo
version: '2'
services:
myapp:
build: .
container_name: "myapp"
image: debian/latest
environment:
- NODE_ENV=development
- FOO=bar
volumes:
@zeqk
zeqk / docker-compose.yml
Created September 17, 2021 19:00 — forked from devzer01/docker-compose.yml
docker-compose mongodb
version: '3'
services:
database:
image: 'mongo'
container_name: 'my-mongo-container' # give your contatner a name
environment:
- MONGO_INITDB_DATABASE=your-database-name # database name you want to make
- MONGO_INITDB_ROOT_USERNAME=my-container-root-username # set your container root username
- MONGO_INITDB_ROOT_PASSWORD=secret # set your contatner root password
volumes: