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
//Do what you want with this example | |
//Author: Fighter19 | |
//Comment: I used Wireshark to get most of the values | |
#include <sys/ioctl.h> | |
#include <errno.h> | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
// copied from rustdoc | |
/// Parses, resolves, and typechecks the given crate | |
fn get_ast_and_resolve(cpath: &Path, libs: HashSet<Path>, cfgs: Vec<~str>) -> (ast::Crate, CrateAnalysis) { | |
use syntax::codemap::dummy_spanned; | |
use rustc::driver::driver::{FileInput, build_configuration, | |
phase_1_parse_input, | |
phase_2_configure_and_expand, | |
phase_3_run_analysis_passes}; | |
let input = FileInput(cpath.clone()); |
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 python | |
import json | |
def json2vdf(stream): | |
""" | |
Read a json file and return a string in Steam vdf format | |
""" |
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
/* round num to c digits */ | |
function round(num, c) { | |
return +(Math.round(num + "e+" + c) + "e-" + c); | |
} | |
/* Adapted from Python from manojpandey, thanks! | |
https://gist.github.com/manojpandey/f5ece715132c572c80421febebaf66ae | |
*/ | |
function rgbTolab(inputColor) { |
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
/* Solarized Dark | |
For use with Jekyll and Pygments | |
http://ethanschoonover.com/solarized | |
SOLARIZED HEX ROLE | |
--------- -------- ------------------------------------------ | |
base03 #002b36 background | |
base01 #586e75 comments / secondary content |
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
# Authored my Maxfan http://github.com/Maxfan-zone http://maxfan.org | |
# This is used to convert tikz code into svg file and load in you jekyll site | |
# | |
# Install: | |
# | |
# 1. Copy this file in your _plugins/ directory. You can customize it, of course. | |
# 2. Make sure texlive and pdf2svg are installed on your computer. | |
# 3. Set path to pdf2svg in _config.yml in "pdf2svg" variable | |
# | |
# Input: |
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
-- | |
-- Test the conn:want() function | |
-- | |
-- Public domain | |
-- | |
require("socket") | |
require("ssl") | |
local params = { | |
mode = "client", |
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
--- | |
-- Find out current branch | |
-- @return {false|git branch name} | |
--- | |
function get_git_branch() | |
for line in io.popen("git branch 2>nul"):lines() do | |
local m = line:match("%* (.+)$") | |
if m then | |
return m | |
end |
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 os | |
""" | |
Renames the filenames within the same directory to be Unix friendly | |
(1) Changes spaces to hyphens | |
(2) Makes lowercase (not a Unix requirement, just looks better ;) | |
Usage: | |
python rename.py | |
""" |
OlderNewer