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
| <?php | |
| $ghost = 'XXX.XXX.XXX.XXX'; | |
| $guser = 'USER_NAME'; | |
| $gpwd = 'PASSWORD'; | |
| $gdbname = 'DB_NAME'; | |
| $db = mysql_connect($ghost, $guser, $gpwd) or die("Could not connect: " . mysql_error()); | |
| mysql_select_db ($gdbname, $db) or die (mysql_error($db)); |
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
| ;; Taken from here: https://emacs.stackexchange.com/questions/34894/how-to-execute-a-command-on-the-selection-shell-command-on-region-in-evil-mode | |
| (defun shell-command-on-region-and-select | |
| (start end command | |
| &optional output-buffer replace | |
| error-buffer display-error-buffer | |
| region-noncontiguous-p) | |
| "Wrapper for 'shell-command-on-region', re-selecting the output. | |
| Useful when called with a selection, so it can be modified in-place" | |
| (interactive) |
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
| package main | |
| import ( | |
| "bytes" | |
| "fmt" | |
| "github.com/nelhage/gojit" | |
| "github.com/nelhage/gojit/amd64" | |
| ) |
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
| #!/bin/sh | |
| # | |
| # Shell script that configures gnome-terminal to use solarized theme | |
| # colors. Written for Ubuntu 11.10, untested on anything else. | |
| # | |
| # Solarized theme: http://ethanschoonover.com/solarized | |
| # | |
| # Adapted from these sources: | |
| # https://gist.github.com/1280177 | |
| # http://xorcode.com/guides/solarized-vim-eclipse-ubuntu/ |
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
| #define MAX 999999999 | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <map> | |
| #include <vector> | |
| #include <queue> | |
| #include <utility> | |
| using namespace std; | |
| class compare |
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
| package main | |
| import ( | |
| "io/ioutil" | |
| "log" | |
| "strings" | |
| "net/http" | |
| "encoding/json" | |
| "fmt" | |
| "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
| gcc -fpic --shared $(python-config --includes) greetmodule.c -o greetmodule.so |
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
| // Copyright 2016 Google Inc. All rights reserved. | |
| // Use of this source code is governed by the Apache 2.0 | |
| // license that can be found in the LICENSE file. | |
| // Command caption reads an audio file and outputs the transcript for it. | |
| package main | |
| import ( | |
| "fmt" | |
| "io" |
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
| tell application "Google Chrome" | |
| set tab_list to every tab in the front window | |
| repeat with the_tab in tab_list | |
| set the_url to the URL of the_tab | |
| tell application "Safari" to open location the_url | |
| end repeat | |
| end tell |
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
| function dsql { | |
| local auth_token | |
| auth_token=$(aws dsql generate-db-connect-admin-auth-token \ | |
| --region us-east-1 \ | |
| --expires-in 3600 \ | |
| --hostname CLUSTER_ENDPOINT_URL) || { echo "Failed to generate auth token" >&2; return 1; } | |
| if [ -z "$auth_token" ]; then | |
| echo "Auth token is empty" >&2 | |
| return 1 |
OlderNewer