Skip to content

Instantly share code, notes, and snippets.

@barbietunnie
barbietunnie / timezone_abbreviation.js
Created April 14, 2021 18:01 — forked from stemar/timezone_abbreviation.js
Get timezone abbreviation from date object or date string
var timezoneAbbreviation = function(timezoneString) {
var timezoneAbbreviations = {
"Afghanistan Time": "AFT",
"Alaska Daylight Time": "AKDT",
"Alaska Standard Time": "AKST",
"Amazon Summer Time": "AMST",
"Amazon Time": "AMT",
"Arabia Standard Time": "AST",
"Argentina Time": "ART",
"Armenia Summer Time": "AMST",
@barbietunnie
barbietunnie / GDrive.py
Created March 30, 2021 18:23 — forked from rajarsheem/GDrive.py
Python terminal client for Google Drive for easy uploading, deleting, listing, sharing files or folders. (See usage in the comment)
from __future__ import print_function
import sys
import io
import pip
import httplib2
import os
from mimetypes import MimeTypes
@barbietunnie
barbietunnie / jest-array-object-match.md
Last active March 5, 2021 11:38 — forked from andreipfeiffer/jest-toContainObject.js
Matching all or part of an object in array with Jest

Jest matching objects in array

You can check if an Array contains a subset of an object as follows:

const state = [
  { type: 'START', data: 'foo' },
  { type: 'START', data: 'baz' },
  { type: 'END', data: 'foo' },
];
@barbietunnie
barbietunnie / list-of-curl-options.txt
Created November 12, 2020 08:13 — forked from eneko/list-of-curl-options.txt
List of `curl` options
$ curl --help
Usage: curl [options...] <url>
--abstract-unix-socket <path> Connect via abstract Unix domain socket
--alt-svc <file name> Enable alt-svc with this cache file
--anyauth Pick any authentication method
-a, --append Append to target file when uploading
--basic Use HTTP Basic Authentication
--cacert <file> CA certificate to verify peer against
--capath <dir> CA directory to verify peer against
-E, --cert <certificate[:password]> Client certificate file and password
@barbietunnie
barbietunnie / upgrade-ubuntu-apt.yml
Last active September 7, 2020 17:35 — forked from kiview/upgrade.yml
Ubuntu upgrade with Ansible
---
- hosts:
- all
become: true
tasks:
- name: Update apt cache
apt: update_cache=yes
- name: Upgrade packages
apt: upgrade=dist
@barbietunnie
barbietunnie / multipe-python-versions.md
Last active August 18, 2020 11:20 — forked from Bouke/gist:11261620
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@barbietunnie
barbietunnie / scrapy.md
Created June 28, 2020 14:49 — forked from bradtraversy/scrapy.md
Scrapy commands and code
@barbietunnie
barbietunnie / additional_notes.md
Last active November 9, 2023 19:54 — forked from JaisonBrooks/remove_input_number_scroll.js
Disable Input[type=number] scroll action

Disable Input[type=number] scroll action

WebKit desktop browsers add little up down arrows to number inputs called spinners.

These spinners have their value changed inadvertently when the scroll wheel is active on the number field. To prevent this from happen, you may choose to prevent this functionality, even though it ignores accessibility considerations.

Here are further discussions regarding this:

var jsonData = pm.response.json();
var tweets = '';
var all_links = [];
// list out all our links.
tweets = "<h2>Bookmarks</h2>";
tweets = tweets + '<ul>';
var tweet_results = jsonData.globalObjects.tweets;
@barbietunnie
barbietunnie / example.cs
Created February 21, 2020 11:59 — forked from brandonmwest/example.cs
Generating base64-encoded Authorization headers in a variety of languages
httpClient.DefaultRequestHeaders.Authorization =
new AuthenticationHeaderValue(
"Basic",
Convert.ToBase64String(
System.Text.ASCIIEncoding.ASCII.GetBytes(
string.Format("{0}:{1}", username, password))));