Skip to content

Instantly share code, notes, and snippets.

Shawn Q Jackson gt50

Block or report user

Report or block gt50

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:addb461b13517f5c76465dc97c1a86f0
/*
* 1. Declare a madLib variable
* 2. Use the adjective1, adjective2, and adjective3 variables to set the madLib variable to the message:
*
* 'The Intro to JavaScript course is amazing. James and Julia are so fun. I cannot wait to work through the rest of this entertaining content!'
*/
var adjective1 = 'amazing';
var adjective2 = 'fun';
var adjective3 = 'entertaining';
@gt50
gt50 / rocketchatetl.py
Created Jun 7, 2018
Import rocket chat messages into sql server
View rocketchatetl.py
server_name = '10.1.2.254'
username = 'rocketchat'
password = 'uMdB9WAtVauyMFc'
database = 'rocketchat'
import pymongo
import pyodbc
import pandas as pd
import urllib.parse
from sqlalchemy import create_engine
View win_ping.yml
---
# This playbook uses the win_ping module to test connectivity to Windows hosts
- name: Ping
hosts: all
tasks:
- name: ping
win_ping:
@gt50
gt50 / win_update.yml
Created Feb 8, 2018 — forked from elordahl/win_update.yml
Ansible playbook to run Windows Update and restart, if required
View win_update.yml
---
# Ansible playbook to run Windows Update and restart, if required
#
# http://docs.ansible.com/ansible/win_updates_module.html
# https://docs.ansible.com/ansible/win_reboot_module.html
- name: Windows Update
hosts: all
gather_facts: false
tasks:
@gt50
gt50 / 20180111.py
Created Jan 12, 2018
willmadison challenge
View 20180111.py
s = "abacabaabacaba"
sset = sorted(set(s), key=s.index)
for i in sset:
count = 0
for j in s:
if j == i:
count += 1
if count == 1:
print(i)
View gist:20473c06322ee372a0dbc3348a153d4a
function checkUnread() {
var e = document.getElementsByClassName("feedUnreadCount")
var t = 0;
for( i = 0; i < e.length; i++ ) t += parseInt(e[i].innerHTML.trim() || 0);
updateBadge(t);
}
function updateBadge(e) {
e >= 1 ? document.title = "(" + e + ") " + originalTitle : document.title = originalTitle
}
View gist:86a4c45299e6c5c34ba477fbdfc751c8
#!/bin/python3
import sys
from functools import reduce
def solve(a0, a1, a2, b0, b1, b2):
# Complete this function
a = [a0, a1, a2]
b = [b0, b1, b2]
alice = sum([1 if i-j > 0 else 0 for i,j in zip(a,b)])
View gist:1713b1310be54bbfdf46d079c850436d
/*
Enter your query here.
Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error.
*/
declare @maxprime int
declare @i int
declare @j int
declare @answer varchar
declare @isprime bit
set @maxprime = 10
View gist:9744b8dd07baf8545ed0966fe2bff47c
import timeit
def array123(arr):
return ''.join(list(map(str,arr))).find('123') >= 0
def array123_noob(arr):
stack = [0,0,0]
for num in arr:
stack.append(num)
stack.pop(0)
View gist:9723299bb947271390f647db74e7368f
import timeit
def array123(arr):
return ''.join(list(map(str,arr))).find('123') >= 0
def array123_noob(arr):
stack = [0,0,0]
for num in arr:
stack.append(num)
stack.pop(0)
You can’t perform that action at this time.