made with esnextbin
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
/** | |
* Prism: Lightweight, robust, elegant syntax highlighting | |
* MIT license http://www.opensource.org/licenses/mit-license.php/ | |
* @author Lea Verou http://lea.verou.me | |
*/(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[ |
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
string hByte(unsigned int bytes){ | |
string r; | |
if (bytes <= 0) r = "0 Bytes"; | |
else if (bytes >= 1073741824) r = to_string(bytes/1073741824) + " GBytes"; | |
else if (bytes >= 1048576) r = to_string(bytes/1048576) + " MBytes"; | |
else if (bytes >= 1024) r = to_string(bytes/1024) + " KBytes"; | |
return r; | |
}; |
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
\documentclass[12pt,utf8,twocolumn,a4paper]{article} | |
\usepackage[utf8]{inputenc} | |
\usepackage[brazilian]{babel} | |
\usepackage{mathtools} | |
\usepackage{amsmath} | |
\usepackage{graphicx} | |
\usepackage[margin=2cm]{geometry} | |
\newcommand{\sidenote}[1]{\marginpar{\footnotesize{#1}}} | |
\newcommand{\drawspace}[2]{\setlength{\unitlength}{#1}\begin{picture}(1,1)\end{picture}\\{\footnotesize #2}} |
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
// Calculate the thread global position, taken it's thread position within the block. | |
__device__ __inline__ uint3 __getGlobalPosition (uint3 blockIdx, dim3 blockDim, uint3 threadIdx) { | |
return make_uint3(blockIdx.x * blockDim.x + threadIdx.x, blockIdx.y * blockDim.y + threadIdx.y, blockIdx.z * blockDim.z + threadIdx.z); | |
}; | |
// Device function to return the index of a given thread within a block. | |
__device__ __inline__ unsigned int __tIndex(uint3 b, dim3 bd, uint3 t) { | |
return t.x + t.y*bd.x + t.z*bd.x*bd.z; | |
}; |
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 | |
if [ "$#" != "1" ]; then | |
echo -e "Usage: cuda [on|off]" | |
exit 1 | |
fi | |
if [ "$1" == "on" -o "$1" == "ON" ]; then | |
sudo tee /proc/acpi/bbswitch <<<ON | |
sleep 1 |
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 | |
# Copyleft 2015 - Leonardo Kewitz github.com/kewitz | |
# intel_pstate max cpu-frequency script. | |
PMAX=/sys/devices/system/cpu/intel_pstate/max_perf_pct | |
CPUINFO=/proc/cpuinfo | |
if [ "$#" != "1" ] | |
then | |
echo -e "Usage: cpf 30-100" |
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
mpl.rc('font', weight = 'light', size = 8, **{'family':'serif','serif':['Times New Roman']}) | |
mpl.rc('text', usetex=True) | |
mpl.rc('legend', borderaxespad = 0.3, fontsize = 6, handlelength = 2, markerscale = 1, labelspacing = 0.3, numpoints = 1) | |
figsize = (3.3,1.8) |
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
figsize = (3.5, 3.5) | |
#plt.style.use('grayscale') | |
plt.rc('font', size = 10, **{'family':'serif','serif':['Times New Roman']}) | |
plt.rc('text', usetex=True) | |
plt.rc('legend', fancybox=True) | |
colors = plt.rcParams['axes.color_cycle'] | |
def lines(x, ys, labels, filename): | |
series = len(ys) | |
xlabels = x; |
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
/* | |
Installation: | |
1. Right Click on the Vimium icon | |
2. Select "Options" | |
3. On the footer, click on "Show Advanced Options" | |
4. Paste this inside "CSS for link hints" textbox | |
5. On the footer, click on "Save Changes" | |
*/ | |
div > .vimiumHintMarker { | |
background: #000; |
OlderNewer