This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Combining ui-router with directives to make beautiful, dynamic, controller-less apps | |
//Taken from here: http://stackoverflow.com/a/32875215/4993527 | |
$stateProvider.state('general', { | |
url: '/general', | |
views: { | |
main: { | |
template: '<general-directive></general-directive>' | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# wrap file in square brackets and output to new file | |
gawk '{ print "["$0"]" }' inputfile > outputfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# output to /tmp due to file permissions, but you could write to any file if you're running locally. | |
\copy (SELECT row_to_json(t) FROM (SELECT * FROM partner_stockrecord) t) to /tmp/partner_stockrecord.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- | |
hosts: ionic-vagrant | |
name: "Ionic meets vagrant" | |
roles: | |
- martinmicunda.common | |
- martinmicunda.nodejs | |
- martinmicunda.ionic | |
- williamyeh.oracle-java | |
- nickp666.android-sdk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Initialize a new OS with my preferred defaults | |
command_exists() { | |
type "$1" &> /dev/null ; | |
} | |
# Anything we download can be dropped and installed from here without fear | |
cd /tmp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Tested on Ubuntu/trusty64 | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install libgl1-mesa-dev:i386 | |
sudo apt-get install openjdk-7-jdk | |
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz ~/ | |
tar zxvf ~/android-sdk-linux |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from subprocess import check_call | |
def post_save(model, os_path, contents_manager): | |
"""post-save hook for converting notebooks to .py and .html files.""" | |
if model['type'] != 'notebook': | |
return # only do this for notebooks | |
d, fname = os.path.split(os_path) | |
check_call(['ipython', 'nbconvert', '--to', 'script', fname], cwd=d) | |
check_call(['ipython', 'nbconvert', '--to', 'html', fname], cwd=d) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Example of making a request to JIRA as a trusted application. | |
In this example, we create a new issue as an arbitrary user. | |
More information on this technique at: | |
https://answers.atlassian.com/questions/247528/how-do-you-impersonate-a-user-with-jira-oauth | |
""" | |
import oauth2 | |
import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mail_address = '' | |
password = '' | |
from selenium import webdriver | |
UA = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0' | |
PHANTOMJS_ARG = {'phantomjs.page.settings.userAgent': UA} | |
driver = webdriver.PhantomJS(desired_capabilities=PHANTOMJS_ARG) | |
url = 'https://www.google.com/accounts/Login?hl=ja&continue=http://www.google.co.jp/' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2018-10-03T16:20:18.770Z","extensionVersion":"v3.1.2"} |
OlderNewer