Skip to content

Instantly share code, notes, and snippets.

View nealrs's full-sized avatar
💭
code monster

Neal Shyam nealrs

💭
code monster
View GitHub Profile
@nealrs
nealrs / neal.json
Last active June 1, 2022 21:09
source file for NealAPI (Git@Me issue 69)
{
"neal" : [
{
"year":1983,
"live": "New Delhi, India",
"school": null,
"work": null
},
{
"year":1984,
@ChrisJamesC
ChrisJamesC / Yo
Last active August 29, 2015 14:05
Utlimate Yo
#!/usr/bin/python
# This script first executes the command passed as argument, then, when the command
# is done, it sends you a yo
#
# All you need to do is define the YO_USER and YO_TOKEN environment variables with:
# YO_USER: your Yo username
# YO_TOKEN: the Yo API token corresponding to the Yo API account you want to receive
# Yos from, don't forget to subscribe to your accounts.
#
// XPath CheatSheet
// To test XPath in your Chrome Debugger: $x('/html/body')
// http://www.jittuu.com/2012/2/14/Testing-XPath-In-Chrome/
// 0. XPath Examples.
// More: http://xpath.alephzarro.com/content/cheatsheet.html
'//hr[@class="edge" and position()=1]' // every first hr of 'edge' class
@midu
midu / konami.coffee
Last active November 1, 2019 11:29
Watch for the konami code on your page
userInputs = []
konami = [
38, 38, # ↑ ↑
40, 40, # ↓ ↓
37, 39, # ← →
37, 39, # ← →
66, 65 # B A
16, 13 # ⇧ ↩ (shift, enter)
]
@DanHerbert
DanHerbert / fix-homebrew-npm.md
Last active February 12, 2024 17:18
Instructions on how to fix npm if you've installed Node through Homebrew on Mac OS X or Linuxbrew

OBSOLETE

This entire guide is based on an old version of Homebrew/Node and no longer applies. It was only ever intended to fix a specific error message which has since been fixed. I've kept it here for historical purposes, but it should no longer be used. Homebrew maintainers have fixed things and the options mentioned don't exist and won't work.

I still believe it is better to manually install npm separately since having a generic package manager maintain another package manager is a bad idea, but the instructions below don't explain how to do that.

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

@gabemarshall
gabemarshall / excel.py
Created March 5, 2014 17:31
Cracking a password protected excel doc with python
import sys
import win32com.client
openedDoc = win32com.client.Dispatch("Excel.Application")
filename= sys.argv[1]
password_file = open ( 'wordlist.lst', 'r' )
passwords = password_file.readlines()
password_file.close()
passwords = [item.rstrip('\n') for item in passwords]
@zackbloom
zackbloom / gist:7774909
Created December 3, 2013 18:36
Bookmarklet to run sortable.js (http://github.hubspot.com/sortable/docs/welcome/) on every table on the page
javascript:(function()%7B(function()%7Bvar%20a%2Cb%2Cc%2Cd%2Ce%2Cf%3Ba%3D%22table%5Bdata-sortable%5D%22%2Cc%3D%2F%5E-%3F%5B%C2%A3%24%C2%A4%5D%3F%5B%5Cd%2C.%5D%2B%25%3F%24%2F%2Cf%3D%2F%5E%5Cs%2B%7C%5Cs%2B%24%2Fg%2Ce%3D%22ontouchstart%22in%20document.documentElement%2Cb%3De%3F%22touchstart%22%3A%22click%22%2Cd%3D%7Binit%3Afunction(b)%7Bvar%20c%2Ce%2Cf%2Cg%2Ch%3Bfor(null%3D%3Db%26%26(b%3D%7B%7D)%2Cnull%3D%3Db.selector%26%26(b.selector%3Da)%2Ce%3Ddocument.querySelectorAll(b.selector)%2Ch%3D%5B%5D%2Cf%3D0%2Cg%3De.length%3Bg%3Ef%3Bf%2B%2B)c%3De%5Bf%5D%2Ch.push(d.initTable(c))%3Breturn%20h%7D%2CinitTable%3Afunction(a)%7Bvar%20b%2Cc%2Ce%2Cf%2Cg%3Bif(1%3D%3D%3Da.tHead.rows.length%26%26%22true%22!%3D%3Da.getAttribute(%22data-sortable-initialized%22))%7Bfor(a.setAttribute(%22data-sortable-initialized%22%2C%22true%22)%2Ce%3Da.querySelectorAll(%22th%22)%2Cb%3Df%3D0%2Cg%3De.length%3Bg%3Ef%3Bb%3D%2B%2Bf)c%3De%5Bb%5D%2C%22false%22!%3D%3Dc.getAttribute(%22data-sortable%22)%26%26d.setupClickableTH(a%2Cc%2Cb)%3Breturn%20a%7D%7D
@lcasartelli
lcasartelli / regex.js
Created October 23, 2013 14:30
Useful regexes
var email_regex = /^(?:[a-zA-Z0-9!#$%&'*+\/=?\^_`{|}~\-]+(?:\.[a-zA-Z0-9!#$%&'*+\/=?\^_`{|}~\-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-z0-9\-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-]*[a-zA-Z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9\-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/;
var uuid_regex = /^[0-9a-zA-Z\-]+$/;
var url_regex = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)/;
var country_code_regex = /^\+{0,1}[0-9]{1,4}$/;
var phone_regex = /^[0-9\-().\s]{10,15}$/;
@nealrs
nealrs / check.py
Last active December 15, 2016 02:58
supply a first, last, and domain name -- and this script will run through common email patterns to find valid email addresses. worried about domains with catchalls & missing mx records? yeah we got that covered. $ python check.py eric cartman southpark.com
#!/usr/bin/env python
# encoding: utf-8
# install dependencies: sudo pip install validate_email pyDNS
# run it: python check.py robin hood gmail.com
# FYI, forwarding addresses (not catchalls) will report 'probably not valid'. that's all i've got right now.
import sys
from validate_email import validate_email
@millermedeiros
millermedeiros / osx_setup.md
Last active May 1, 2024 20:46
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...