Skip to content

Instantly share code, notes, and snippets.

@mpslanker
mpslanker / hack.sh
Created January 27, 2013 14:29 — forked from erikh/hack.sh
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
r = requests.get(file_url)
size = int(r.headers['Content-Length'].strip())
self.bytes = 0
widgets = [name, ": ", Bar(marker="|", left="[", right=" "),
Percentage(), " ", FileTransferSpeed(), "] ",
self,
" of {0}MB".format(str(round(size / 1024 / 1024, 2))[:4])]
pbar = ProgressBar(widgets=widgets, maxval=size).start()
file = []
for buf in r.iter_content(1024):
*markdown-cheat-sheet.jax* Markdown カンニングペーパー
作者: Kyo Nagashima <kyo@hail2u.net>
バージョン: 0.04
説明: Markdown 記法のカンニングペーパーです。
1. 記法の例 |markdown-cheat-sheet-examples|
1.1 段落 |markdown-cheat-sheet-paragraph|
1.2 改行 |markdown-cheat-sheet-linebreak|
1.3 テキストの強調 |markdown-cheat-sheet-emphasis|
# Use this command as a shortcut to launch powershell as a different user but still elevated if UAC is on.
# If you would like the shortcut to have the powershell logo, you can set it by changind the icon and point at:
# %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe
C:\Windows\System32\runas.exe /savecred /env /noprofile /user:[domain]\[username] "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noprofile -command \"start-process powershell -verb RunAs\""
#!/usr/bin/python
# Daniel De Marco - ddm@didiemme.net - 2012-02-23
# suds from https://fedorahosted.org/suds/
import suds
import sys
def get_warr(svctag):
var jq = document.createElement('script');
// You can change the version number (2.1.0) to any version hosted via Google's Hosted Libraries.
// https://developers.google.com/speed/libraries/devguide#jquery
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// After running the above commands you can run the command below if necessary.
jQuery.noConflict();
Many of these rely on using nircmd.exe from from NirSoft as well.
Turn remote computer speaker to to low.
psexec -s \\computername -c -f nircmd.exe changesysvolume 2000 -u Administrator -p Password
Turn remote computer speaker to to max.
psexec -s \\computername -c -f nircmd.exe setsysvolume 65535 -u Administrator -p Password
Open CD-Rom tray of remote computer.
psexec -s \\computername -c -f nircmd.exe cdrom open d: -u Administrator -p Password
{
"cmd": ["vcvars32.bat", "&", "cl", "/EHsc", "${file}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.cpp, source.c++",
// By default cl is not in your PATH, so add it to your path (preferably)
// or uncomment "path" and check that it has correct value
//"path": "path:/to/folder/where/cl.exe/located",
// this also will set path for vcvars32.bat
"shell": true, // Without this sublime has hard times to parse "&" in out command line
# This enable subl <file.ext> on mac os x for sublime text 3
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
@mpslanker
mpslanker / Preferences.sublime-settings
Created February 5, 2016 16:06
Sublime Text theme, scheme, and functionality settings.
{
// Style Settings (Sublime)
"theme" : "Material-Theme.sublime-theme",
"color_scheme" : "Packages/Material Theme/schemes/Material-Theme-OceanicNext.tmTheme",
"show_full_path" : true,
"show_minimap" : false,
"bold_folder_labels" : true,
"fade_fold_buttons" : false,
"wide_caret" : true,