This file contains 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
Create a method like the following: | |
/** | |
* Fix https://github.com/square/okhttp/issues/184 | |
* | |
* @return an unfucked OkHttpClient for use with a RestAdapter | |
*/ | |
public static OkClient createClient() { | |
OkHttpClient client = new OkHttpClient(); | |
SSLContext sslContext; |
This file contains 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
SELECT SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1) | |
FROM master.sys.master_files | |
WHERE database_id = 1 AND file_id = 1 |
This file contains 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
SELECT L.request_session_id AS SPID, | |
DB_NAME(L.resource_database_id) AS DatabaseName, | |
O.Name AS LockedObjectName, | |
P.object_id AS LockedObjectId, | |
L.resource_type AS LockedResource, | |
L.request_mode AS LockType, | |
ST.text AS SqlStatementText, | |
ES.login_name AS LoginName, | |
ES.host_name AS HostName, | |
TST.is_user_transaction as IsUserTransaction, |
This file contains 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
# Assuming modem is a Motorola 2210-02-1006 running in bridge mode w/ a LAN IP of 192.168.1.254 | |
# Router is WRT54G running Tomato w/ LAN IP of 192.168.2.1 and is handling PPPoE | |
# In order to access modem's web UI via LAN: | |
# 1) Add the following script under Administration > Scripts > Init: | |
sleep 5 | |
ip addr add 192.168.1.2/24 dev vlan1 brd + | |
iptables -I POSTROUTING -t nat -o vlan1 -d 192.168.1.0/24 -j MASQUERADE | |
# 2) Add the following script under Administration > Scripts > Firewall: | |
iptables -I POSTROUTING -t nat -o vlan1 -d 192.168.1.0/24 -j MASQUERADE |
This file contains 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/bash | |
# Justin Garrick | |
# Put this script in a folder with get_flash_videos (http://code.google.com/p/get-flash-videos/) | |
# and your bookmarks.html file and run it | |
# This does no error checking/handling -- if a video cannot be found, it just won't be grabbed | |
# Grabs the urls from all bookmarks containing youtube in the url | |
for URL in `grep -i "<a href=.*youtube.*" bookmarks.html | cut -d '"' -f 2`; do | |
echo "Downloading ${URL}..." | |
# Download video as high quality mp4 if possible |
This file contains 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 subprocess | |
def looksLikeBeginning(doc,seg,adr): | |
if doc.is64Bits() and seg.readByte(adr) == 0x55 and seg.readByte(adr + 1) == 0x48 and seg.readByte(adr + 2) == 0x89 and seg.readByte(adr + 3) == 0xE5: | |
return True | |
if not doc.is64Bits() and seg.readByte(adr) == 0x55 and seg.readByte(adr + 1) == 0x89 and seg.readByte(adr + 2) == 0xE5: | |
return True | |
return False | |
doc = Document.getCurrentDocument() |
This file contains 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
HotKeySet("{DEL}", "stop") | |
Opt("MouseCoordMode", 0) | |
$i = 0 | |
$i2 = 0 | |
WinActivate("Diablo II") | |
WinWaitActive("Diablo II") | |
Do | |
$i = $i + 1 |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Drawing; | |
using System.IO; | |
using System.Linq; | |
using System.Text; | |
using MyProject.Domain; | |
using EO.Pdf; | |
using EO.Pdf.Acm; |
This file contains 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
USE [master] | |
DECLARE @dbName NVARCHAR(MAX) | |
SET @dbName ='Derp' -- Your DB name here | |
DECLARE @sql NVARCHAR(MAX) | |
DECLARE @template NVARCHAR(MAX) | |
DECLARE @dataDir NVARCHAR(MAX) | |
SET @dataDir = (SELECT SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1) FROM master.sys.master_files WHERE database_id = 1 AND file_id = 1) |
This file contains 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
//Add | |
//Request.Content.ReadAsStreamAsync().ContinueWith(t => t.Result.Seek(0, SeekOrigin.Begin)).Wait(); | |
//to your POST method, e.g. | |
[AntiForgeryToken] | |
public WeldProjectInfo Post([FromBody]RequestDetail details) | |
{ | |
try | |
{ | |
Request.Content.ReadAsStreamAsync().ContinueWith(t => t.Result.Seek(0, SeekOrigin.Begin)).Wait(); |
OlderNewer