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 2010 Daniel Snider <qtipkk@gmail.com> | |
| # | |
| """Django and WSGI ISAPI request handler. | |
| Make a new application pool for each project and have an IIS Application point to a directory | |
| containing either a .wsgi file, or a django project with a settings.py | |
| """ | |
| import sys | |
| from Http.WSGI import RunWSGI | |
| from Http import Env |
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
| #!/usr/bin/env python | |
| from sh import tmux | |
| curwin = tmux('display-message', p='#{window_index}').strip() | |
| windows = [line.split()[0].strip(':') for line in tmux('list-windows')] | |
| for src, dest in zip(windows, range(1, len(windows)+1)): | |
| if str(src) == str(curwin): | |
| curwin = dest | |
| if str(dest) != str(src): | |
| tmux('move-window', s=src, t=dest) | |
| tmux('select-window', t=curwin) |
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
| #!/usr/bin/env python | |
| from sh import tmux | |
| curclient = tmux('display-message', p='#{client_tty}').strip() | |
| clients = [line.split(':')[0] for line in tmux('list-clients')] | |
| for client in clients: | |
| if str(client) != str(curclient): | |
| tmux('detach-client', t=client) |
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/bash | |
| curl --silent https://coinbase.com/api/v1/prices/spot_rate | jq -r '"1BTC = $" + (.amount | tostring)' |
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
| def lerp(a,b,x): | |
| """ | |
| 0.0 <= a,b <= 1.0 | |
| 0.0 <= x <= 1.0 | |
| v x | |
| ---- | |
| a (0) | |
| b (1) |
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
| #include <stdio.h> | |
| char msg[] = { 0x41, 0x6D, 0x65, 0x72, 0x69, 0x63, 0x61, 0x20, 0x43, 0x61, 0x6E, 0x20, 0x43, 0x6F, 0x64, 0x65, 0x20 }; | |
| int main(void){ | |
| printf("%s\n", msg); // output: America Can Code | |
| return 0; | |
| } |
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
| // ==UserScript== | |
| // @match http://jira.fanhattan.com/* | |
| // @match https://jira.fanhattan.com/* | |
| // ==/UserScript== | |
| var li = document.createElement("li"); | |
| var label = document.createElement("li"); | |
| document.querySelector(".aui-nav").appendChild(li); | |
| document.querySelector(".aui-nav").appendChild(label); |
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 cubic; | |
| public class Cubic { | |
| public static final float cubic(float x, float... v) { | |
| if (x <= v[0]) { | |
| return v[1]; | |
| } | |
| x = Math.min(Math.max(v[0], x), v[v.length - 2]); | |
| int i; | |
| for (i = 0; i < v.length && v[i + 6] < x; i += 6); |
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
| /* | |
| $ clang++ const.cpp -o const && ./const | |
| Bus error: 10 | |
| */ | |
| #include <stdio.h> | |
| const char* text = "hello, world"; | |
| int main(){ |
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
| // ==UserScript== | |
| // @match http://stackoverflow.com/* | |
| // @match https://stackoverflow.com/* | |
| // @match http://serverfault.com/* | |
| // @match https://serverfault.com/* | |
| // @match https://*.stackexchange.com/* | |
| // @match http://*.stackexchange.com/* | |
| // ==/UserScript== | |
| document.querySelector("#hot-network-questions").style.display = "none"; |
OlderNewer