Skip to content

Instantly share code, notes, and snippets.

View timothystewart6's full-sized avatar
🚀
Ship it!

Techno Tim timothystewart6

🚀
Ship it!
View GitHub Profile
@badsyntax
badsyntax / email_validation.js
Created November 29, 2010 10:32
rfc822 email validation in JS
// See http://rosskendall.com/blog/web/javascript-function-to-check-an-email-address-conforms-to-rfc822
function isEmail(email){
return /^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/.test( email );
}
@tsabat
tsabat / zsh.md
Last active December 25, 2023 19:16
Getting oh-my-zsh to work in Ubuntu
@Kinzcool
Kinzcool / gist:f2b42ad6f6ba6054cd53
Last active February 6, 2020 12:45
World of Warcraft Cataclysm (4.3.4 - Build 15595) - Download Links.
http://ak.worldofwarcraft.com.edgesuite.net/wow-pod-retail/NA/15050.direct/Data/art.MPQ
http://ak.worldofwarcraft.com.edgesuite.net/wow-pod-retail/NA/15050.direct/Data/base-OSX.MPQ
http://ak.worldofwarcraft.com.edgesuite.net/wow-pod-retail/NA/15050.direct/Data/base-Win.MPQ
http://ak.worldofwarcraft.com.edgesuite.net/wow-pod-retail/NA/15050.direct/Data/expansion1.MPQ
http://ak.worldofwarcraft.com.edgesuite.net/wow-pod-retail/NA/15050.direct/Data/expansion2.MPQ
http://ak.worldofwarcraft.com.edgesuite.net/wow-pod-retail/NA/15050.direct/Data/expansion3.MPQ
http://ak.worldofwarcraft.com.edgesuite.net/wow-pod-retail/NA/15050.direct/Data/sound.MPQ
http://ak.worldofwarcraft.com.edgesuite.net/wow-pod-retail/NA/15050.direct/Data/world.MPQ
http://ak.worldofwarcraft.com.edgesuite.net/wow-pod-retail/NA/15050.direct/Data/world2.MPQ
http://ak.worldofwarcraft.com.edgesuite.net/wow-pod-retail/NA/15050.direct/Data/wow-update-base-15211.MPQ
@kljensen
kljensen / mongoose-encrypted-schematype-field.md
Last active June 6, 2023 13:25
Encrypt a text field in Mongoose MongoDB ORM

Encrypting text fields in Mongoose is easy using Node's built-in crypto module. You might want to do this if you're using MongoDB as a service (see the recent MongoHQ security breach); or, if you're storing OAuth tokens that could, in the wrong hands, screw with somebody's account on a 3rd party service. (Of course, you should never encrypt passwords: those should be hashed.)

Imagine you have a Mongoose model like that shown below, which is modified only slighly from the example on the MongooseJS homepage.

var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/test');

var User = mongoose.model('User', {
 name: String,
@sheharyarn
sheharyarn / mongo_backup.sh
Last active January 23, 2024 16:54
Mongodump Shell Script for Cronjob
#!/bin/bash
MONGO_DATABASE="your_db_name"
APP_NAME="your_app_name"
MONGO_HOST="127.0.0.1"
MONGO_PORT="27017"
TIMESTAMP=`date +%F-%H%M`
MONGODUMP_PATH="/usr/bin/mongodump"
BACKUPS_DIR="/home/username/backups/$APP_NAME"
@dchowitz
dchowitz / es6-debugging-in-vscode.md
Last active August 30, 2023 06:23
Debugging ES6 in VS Code

Debugging ES6 in VS Code

My current editor of choice for all things related to Javascript and Node is VS Code, which I highly recommend. The other day I needed to hunt down a bug in one of my tests written in ES6, which at time of writing is not fully supported in Node. Shortly after, I found myself down the rabbit hole of debugging in VS Code and realized this isn't as straightforward as I thought initially. This short post summarizes the steps I took to make debugging ES6 in VS Code frictionless.

What doesn't work

My first approach was a launch configuration in launch.json mimicking tape -r babel-register ./path/to/testfile.js with babel configured to create inline sourcemaps in my package.json. The debugging started but breakpoints and stepping through the code in VS Code were a complete mess. Apparently, ad-hoc transpilation via babel-require-hook and inline sourcemaps do not work in VS Code. The same result for attaching (instead of launch) to `babel-node

@knowbody
knowbody / RNfontWeights.js
Created July 14, 2016 13:42
React Native Font Weight Cheatsheet iOS
{ fontWeight: '100' }, // Thin
{ fontWeight: '200' }, // Ultra Light
{ fontWeight: '300' }, // Light
{ fontWeight: '400' }, // Regular
{ fontWeight: '500' }, // Medium
{ fontWeight: '600' }, // Semibold
{ fontWeight: '700' }, // Bold
{ fontWeight: '800' }, // Heavy
{ fontWeight: '900' }, // Black
@GingerBear
GingerBear / react-native-start-with-link.js
Last active January 5, 2023 01:19
start react native bunlder with link
@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active June 7, 2024 01:28
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@superseb
superseb / cluster.yml
Last active February 7, 2024 09:08
Rancher 2.x custom cluster YAML quicker node failure detection (k8s 1.13)
services:
kubelet:
extra_args:
node-status-update-frequency: 4s
kube-api:
extra_args:
default-not-ready-toleration-seconds: 30
default-unreachable-toleration-seconds: 30
kube-controller:
extra_args: