http://www.willa.me/2013/11/the-six-most-common-species-of-code.html
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
#!/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 | |
# |
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
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): |
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
*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| |
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
#!/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): |
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
Show hidden characters
{ | |
"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 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
<!-- 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.
BASH (man page)
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
^C
$ cat < /dev/tcp/127.0.0.1/23
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 | |
set -e | |
GENTOO_RELEASES_URL=http://distfiles.gentoo.org/releases | |
GENTOO_ARCH=amd64 | |
GENTOO_VARIANT=amd64 | |
TARGET_DISK=/dev/sda |
by Angel Leon. March 17, 2015; August 29, 2019.
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.
OlderNewer