Skip to content

Instantly share code, notes, and snippets.

View gt50's full-sized avatar

Shawn Q Jackson gt50

View GitHub Profile
/*
* 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 June 7, 2018 21:19
Import rocket chat messages into sql server
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
@gt50
gt50 / win_ping.yml
Last active February 9, 2018 03:53
---
# 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 February 8, 2018 21:41 — forked from elordahl/win_update.yml
Ansible playbook to run Windows Update and restart, if required
---
# 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 January 12, 2018 00:39
willmadison challenge
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)
@gt50
gt50 / gist:20473c06322ee372a0dbc3348a153d4a
Created December 13, 2017 22:39
Feedly unread tab for rambox
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
}
#!/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)])
/*
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
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)
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)