Skip to content

Instantly share code, notes, and snippets.

View ummahusla's full-sized avatar
✌️
Check my digital garden (edvins.io)

Edvins Antonovs ummahusla

✌️
Check my digital garden (edvins.io)
View GitHub Profile
@ummahusla
ummahusla / git-overwrite-branch.sh
Last active February 25, 2024 00:06 — forked from brev/git-overwrite-branch.sh
Git overwrite branch with another branch
# overwrite master with contents of feature branch (feature > master)
git checkout feature # source name
git merge -s ours master # target name
git checkout master # target name
git merge feature # source name
@ummahusla
ummahusla / vim-cheat-sheet.md
Created February 18, 2016 11:52
Vim Cheat Sheet

Modes

Vim has two modes insertion mode and command mode. The editor begins in command mode, where the cursor movement and text deletion and pasting occur. Insertion mode begins upon entering an insertion or change command. [ESC] returns the editor to command mode (where you can quit, for example by typing :q!). Most commands execute as soon as you type them except for "colon" commands which execute when you press the ruturn key.

Quitting

  • :x Exit, saving changes
  • :q Exit as long as there have been no changes
  • ZZ Exit and save changes if any have been made
  • :q! Exit and ignore any changes

Inserting Text

@ummahusla
ummahusla / index.js
Created November 21, 2022 14:36
JavaScript DYI map, filter, reduce
const arr = [1, 2, 3, 4, 1, 2, 3];
const originalMap = arr.map(i => i + 1);
const myMap = (arr, cb) => {
let temp = [];
for(let i = 0; i < arr.length; i++) {
temp.push(cb(arr[i]));
}
@ummahusla
ummahusla / Site.php
Created April 1, 2015 10:33
CodeIgniter CRUD
<?php
class Site extends CI_Controller {
function index() {
$this->load->view('options_view');
}
function create() {
$data = array(
'title' => $this->input->post('title'),
@ummahusla
ummahusla / index.html
Last active July 27, 2018 12:29
Currencies
<select className="form-control ignore" id="currency" name="currency">
<option value="36">AED - United Arab Emirates Dirham</option>
<option value="175">AFN - Afghan Afghani</option>
<option value="38">ALL - Albanian Lek</option>
<option value="39">AMD - Armenian Dram</option>
<option value="176">ANG - Netherlands Antillean Guilder</option>
<option value="177">AOA - Angolan Kwanza</option>
<option value="42">ARS - Argentine Peso</option>
<option value="19">AUD - Australian dollar</option>
<option value="178">AWG - Aruban Florin</option>
@ummahusla
ummahusla / index.html
Created January 26, 2018 13:06
Shipping beats perfection
<div class="container">
<div class="logo row">
<div class="twelve column">
<button id="myBtn">Open Modal test</button>
</div>
</div>
<div id="grid">
@ummahusla
ummahusla / .htaccess
Last active January 22, 2016 21:29
WordPress Leverage browser caching .htaccess
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
@ummahusla
ummahusla / text_rotation
Created October 10, 2013 17:10
Text Rotation
.rotate {
/* Safari */
-webkit-transform: rotate(-90deg);
/* Firefox */
-moz-transform: rotate(-90deg);
/* IE */
-ms-transform: rotate(-90deg);
@ummahusla
ummahusla / css_text_shadow
Created October 10, 2013 17:09
CSS text shadow
Regular text shadow:
p { text-shadow: 1px 1px 1px #000; }
Multiple shadows:
p { text-shadow: 1px 1px 1px #000, 3px 3px 5px blue; }
@ummahusla
ummahusla / css_font_families
Created October 10, 2013 17:08
CSS Font Families
Sans-Serif
Arial, sans-serif;
Helvetica, sans-serif;
Gill Sans, sans-serif;
Lucida, sans-serif;
Helvetica Narrow, sans-serif;
sans-serif;
Serif
Times, serif;