Skip to content

Instantly share code, notes, and snippets.

<!-- Form Login -->
<form *ngIf="!wallet?.address" [formGroup]="loginForm">
<textarea
*ngIf="!hasSeeds"
type="text"
class="form-control"
formControlName="seeds"
placeholder="Seeds"
rows="4"
></textarea>
@ackuser
ackuser / init
Created June 22, 2022 07:10
My nvim config
set scrolloff=8
set number
" set relativenumber
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set showcmd
set notermguicolors
call plug#begin('~/.vim/plugged')
@ackuser
ackuser / Messagebox.sol
Created June 8, 2022 10:05
ArrayRemovingElementByReplacingLast
//SPDX-License-Identifier:UNLICENSED
pragma solidity ^0.8.7;
contract Messagebox {
string[] public messages;
uint public lastDate;
address public owner;
copy/delete word under cursor in Vim
yw / byw
Assuming that the cursor is at the first character of the word simply do this in command mode:
yw
y is for yank and w is for word.
Other ways of doing the same thing which are not as efficient:
vey
the v starts visual select mode. e tells vim to move to end of word. y yanks or copies the word. to delete replace y with x.
@ackuser
ackuser / init.vim
Created March 28, 2022 07:33 — forked from celso/init.vim
Neovim setup for OSX users
syntax on
set ruler " Show the line and column numbers of the cursor.
set formatoptions+=o " Continue comment marker in new lines.
set textwidth=0 " Hard-wrap long lines as you type them.
set modeline " Enable modeline.
set esckeys " Cursor keys in insert mode.
set linespace=0 " Set line-spacing to minimum.
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
" More natural splits
set splitbelow " Horizontal split below current.
@ackuser
ackuser / sketchapp_line_CSS
Created February 4, 2022 11:34 — forked from sktwentysix/sketchapp_line_CSS
Convert SketchApp line height to CSS
/*
Sketchapp fro MacOS is a fantastic tool for prototyping, but has some drawbacks that make converting designs to fully functional websites a pain.
One of these is sketchapp's line-height, which doesn't seem to have any relation to CSS line-height values.
This is a simple example of how we can take a line height value from sketch and apply it to a CSS class for styling text:
Lets assume the text in our Sketchapp prototype has a font size of "18px", and line height of "33"...
Our CSS class would look like this:
@ackuser
ackuser / dabblet.css
Created December 14, 2021 16:38 — forked from JosephSilber/dabblet.css
CSS Pac-Man
/* CSS Pac-Man */
#pacman {
width: 1px;
height: 1px;
border: 60px solid red;
border-right-color: transparent;
border-radius: 50%;
}
@ackuser
ackuser / git-pushing-multiple.rst
Created September 1, 2021 08:15 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@ackuser
ackuser / Validatedate.js
Created August 26, 2021 15:19 — forked from ace-racer/Validatedate.js
Validate date in JavaScript (dd/mm/yyyy format)
function validatedate() {
var dateText = document.getElementById("DATE_FIELD_NAME");
if (dateText) {
try {
var errorMessage = "";
var splitComponents = dateText.value.split('/');
if (splitComponents.length > 0) {
var day = parseInt(splitComponents[0]);
var month = parseInt(splitComponents[1]);
var year = parseInt(splitComponents[2]);
@ackuser
ackuser / forward.sh
Created March 4, 2021 20:23 — forked from aoxu/forward.sh
forward socks5 to http/https
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install privoxy
vim /usr/local/etc/privoxy/config
forward-socks5 / 127.0.0.1:1080 .
brew services start privoxy
export https_proxy=http://127.0.0.1:8118;export http_proxy=http://127.0.0.1:8118