Skip to content

Instantly share code, notes, and snippets.

@aaira-a
aaira-a / connectionstrings.py
Created April 17, 2014 09:53
Robot Framework variable file in Python, accessed using extended syntax from test case file.
class database(object):
def __init__(self, env):
if env == 'test':
self.name = str('test mysql 1')
self.host = str('1.1.1.1')
self.port = str('11')
self.login = str('testlogin')
self.password = str('testpass')
@aaira-a
aaira-a / README.md
Created November 3, 2014 02:51
oba essentials

oba2014

Developed on Microsoft Visual C++ 2010 Express (http://go.microsoft.com/?linkid=9709949)

Specific settings:

  1. Right click Project -> Properties
  2. Linker -> Input -> Ignore All Default Libraries -> No
@aaira-a
aaira-a / sitename.conf
Last active August 29, 2015 14:11
redirect subdomains to different ports in nginx
server {
listen 80;
server_name sub1.domain.com;
location / {
proxy_pass http://localhost:8008;
}
}
@aaira-a
aaira-a / .travis.yml
Created December 18, 2014 10:21
patch python or django dependencies from pip on travis virtualenv
language: python
python:
- "3.4"
install: "pip install -r requirements.txt"
before_script:
- "rm /home/travis/virtualenv/python3.4/lib/python3.4/site-packages/django_mailbox/admin.py"
- "rm /home/travis/virtualenv/python3.4/lib/python3.4/site-packages/django_mailbox/models.py"
- "rm /home/travis/virtualenv/python3.4/lib/python3.4/site-packages/django_mailbox/migrations/0*.*"
@aaira-a
aaira-a / akismet.py
Last active August 29, 2015 14:13
Python 2 script to verify Akismet API key validity, usable with Jenkins
import requests
import sys
URL = 'http://rest.akismet.com/1.1/verify-key'
DATA = {'key': 'insert_key_here', 'blog': 'insert_blog_here'}
def verify_akismet_key(url_, data_):
r = requests.post(url_, data=data_)
@aaira-a
aaira-a / README.md
Created March 5, 2015 06:04
Sublime Text 2/3 script to show character position

Copied from here

Save as .py , put in (Preferences > Browse Packages > User) and restart Sublime

@aaira-a
aaira-a / myvb.vb
Last active August 29, 2015 14:21
xls vba script to copy multiple columns to other workbook
Sub CopyColumnsToOtherWorkbook()
Dim srcBook As Workbook
Dim srcSheet As Worksheet
Dim destSheet As Worksheet
Set srcBook = Workbooks.Open("C:\vba\source.xlsm", ReadOnly = True)
Set srcSheet = srcBook.Worksheets("SheetName")
Set destSheet = ThisWorkbook.Worksheets("SheetName")
@aaira-a
aaira-a / gist:b3c0a18838b9fb9f79b8
Last active August 29, 2015 14:23
python inheritance learning gist
class Parent(object):
def __init__(self, param1, param2):
self.param1 = param1
self.param2 = param2
def main(self):
print(self.name)
@aaira-a
aaira-a / startworkflow.ps1
Last active September 10, 2015 03:06
loop start a workflow on sharepoint online using powershell csom
# Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
Add-Type -Path “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll”
Add-Type -Path “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll”
Add-Type -Path “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.WorkflowServices.dll”
# Specify tenant admin and site URL
$SiteUrl = "mysiteurl"
$ListName = "mylistname"
$UserName = "myusername"
$SecurePassword = ConvertTo-SecureString "mypassword" -AsPlainText -Force
@aaira-a
aaira-a / createlistitem.ps1
Last active February 24, 2021 14:39
create a new list item on sharepoint online using powershell csom
# Add references to SharePoint client assemblies and authenticate to Office 365 site - required for CSOM
Add-Type -Path “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll”
Add-Type -Path “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll”
Add-Type -Path “C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.WorkflowServices.dll”
# Specify tenant admin and site URL
$SiteUrl = "mysiteurl"
$ListName = "mylistname"
$UserName = "myusername"
$SecurePassword = ConvertTo-SecureString "mypassword" -AsPlainText -Force