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<iostream> | |
#include<vector> | |
#include<algorithm> | |
using namespace std; | |
const int MAX_32_SIGNED = 2147483647; | |
class AfraidOfEven | |
{ |
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== | |
// @name CPANSyntaxHighlight | |
// @namespace abiteasier.in | |
// @description Enable syntax highlighting when viewing the source on CPAN | |
// @include http://cpansearch.perl.org/src/* | |
// @version 0.9 | |
// @require http://yandex.st/highlightjs/7.3/highlight.min.js | |
// @resource syntaxHighlightCSS http://yandex.st/highlightjs/7.3/styles/github.min.css | |
// @grant GM_addStyle | |
// @grant GM_getResourceText |
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
if exists(':E2v') | |
function! AlignByRE() range | |
let range = a:firstline . ',' . a:lastline | |
let cmd = range | |
let re = input('Enter PCRE to align by: ') | |
if re == "" | |
" Run empty to use previous pattern | |
let cmd .= 'Tabularize' | |
execute cmd | |
else |
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 | |
# Print a list of packages that no other package depends on | |
# Script taken from https://superuser.com/a/570575/3200 | |
PackageCount=0 | |
PackageIter=0 | |
# Populate package array | |
declare -A Packages | |
PackageList=$(cygcheck.exe -c | cut -d' ' -f1 | tail -n +3) |
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
#define __DBL_MIN_EXP__ (-1021) | |
#define __UINT_LEAST16_MAX__ 0xffff | |
#define __ATOMIC_ACQUIRE 2 | |
#define __FLT_MIN__ 1.17549435082228750797e-38F | |
#define __GCC_IEC_559_COMPLEX 2 | |
#define __UINT_LEAST8_TYPE__ unsigned char | |
#define __SIZEOF_FLOAT80__ 16 | |
#define __INTMAX_C(c) c ## L | |
#define __CHAR_BIT__ 8 | |
#define __UINT8_MAX__ 0xff |
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
import random | |
# import matplotlib.pyplot as plt | |
suits = ['hearts', 'diamonds', 'spades', 'clubs'] | |
value = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] | |
cards = [] | |
for item in suits: | |
for number in value: | |
cards.append([number, item]) |
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== | |
// @name YourbanPro | |
// @namespace aaressaar | |
// @match http*://www.urbanpro.com/* | |
// @grant none | |
// @version 0.5 | |
// @author SundaraRaman | |
// @description Remove annoyances and improve UrbanPro interface | |
// ==/UserScript== |
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
" Easy insertion of emojis with C-K | |
execute 'digraph :x 128544' | |
execute 'digraph :) 128578' | |
execute 'digraph :D 128512' | |
execute 'digraph =D 128513' | |
execute 'digraph :P 128523' | |
execute 'digraph :\| 128528' | |
execute 'digraph =\| 128529' | |
execute 'digraph :O 128558' | |
execute 'digraph :/ 128533' |
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
macro showsource(ex0...) | |
InteractiveUtils.gen_call_with_extracted_types_and_kwargs(__module__, :showsource, ex0) | |
end | |
showsource(f, @nospecialize t; kwargs...) = showsource(functionloc(f,t)...; kwargs...) | |
function showsource(file::AbstractString, line::Integer; nlines = 10) | |
run(pipeline(`tail -n +$(line) $file`, `head -n $(nlines)`)) | |
nothing | |
end |
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
<h3><code>Tables.columns</code> usage</h3> | |
<p><pre><code class=", now let's take a look at a case utlizing [`Tables.columns`](@ref)."> | |
The following code is taken from the [DataFrames.jl](https://github.com/JuliaData/DataFrames.jl/blob/master/src/other/tables.jl) | |
Tables.jl implementation: | |
</code></pre> | |
getvector(x::AbstractVector) = x | |
getvector(x) = collect(x)</p> | |
<h1>note that copycols is ignored in this definition (Tables.CopiedColumns implies copies have already been made)</h1> |
OlderNewer