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|
#!/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):
{
"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
@mpslanker
mpslanker / code.md
Created September 30, 2017 04:41 — forked from weakish/code.md
The Six Most Common Species Of #Code #java #fun
@mpslanker
mpslanker / Mac OS X 10_5_ Windows Ctrl.xml
Created May 4, 2018 14:50 — forked from fljot/Mac OS X 10_5_ Windows Ctrl.xml
AutoHotkey mappings to emulate OSX keyboard shortcuts on Windows
<!-- put this to IDEA keymaps config folder. For v13 it is <userdir>\.IntelliJIdea13\config\keymaps\ -->
<?xml version="1.0" encoding="UTF-8"?>
<keymap version="1" name="Mac OS X 10.5+ Windows Ctrl" parent="Mac OS X 10.5+">
<action id="$Copy">
<keyboard-shortcut first-keystroke="meta C" />
<keyboard-shortcut first-keystroke="meta INSERT" />
<keyboard-shortcut first-keystroke="control C" />
<keyboard-shortcut first-keystroke="control INSERT" />
</action>
<action id="$Cut">

Here are several different ways to test a TCP port without telnet.

$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C

$ cat &lt; /dev/tcp/127.0.0.1/23
@mpslanker
mpslanker / gentoo-installer.sh
Last active August 17, 2019 06:43 — forked from sormy/gentoo-installer.sh
gentoo quick install script
#!/bin/bash
set -e
GENTOO_RELEASES_URL=http://distfiles.gentoo.org/releases
GENTOO_ARCH=amd64
GENTOO_VARIANT=amd64
TARGET_DISK=/dev/sda
@mpslanker
mpslanker / compiling_building_c_cpp_notes.md
Created September 12, 2019 04:37 — forked from gubatron/compiling_building_c_cpp_notes.md
Things to remember when compiling and linking C/C++ programs

Things to remember when compiling/linking C/C++ software

by Angel Leon. March 17, 2015; August 29, 2019.

Include Paths

On the compilation phase, you will usually need to specify the different include paths so that the interfaces (.h, .hpp) which define structs, classes, constans, and functions can be found.

With gcc and llvm include paths are passed with -I/path/to/includes, you can pass as many -I as you need.

In Windows, cl.exe takes include paths with the following syntax: /I"c:\path\to\includes\ you can also pass as many as you need.