- show code step by step Also called fragments inside code http://stackoverflow.com/questions/24151563/reveal-js-add-fragments-inside-code/25396283#25396283
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
STEP 1: | |
$ sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion | |
STEP 2: | |
$ bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) | |
STEP 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
git config --global user.name "<name>" | |
git config --global user.email "<email>" | |
cat ~/.gitconfig | |
mkdir git-demo | |
cd git-demo | |
git init | |
touch hello.txt | |
git add . | |
git commit -a | |
vi hello.txt |
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
# we have software depot in perforce //sw/... | |
# problem is while syncing we get: | |
# Request too large (over 750000); see 'p4 help maxresults'. | |
# here is simple function to resolve this: | |
# if you are using zsh | |
# $ setopts interactivecomments | |
sync_p4 () | |
{ | |
p4 -r 1 sync $1...$2; # sync $1 at $2 ; possible $2's can be #0 ;) or @my-cl-number | |
# retry only once |
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
Index: winctrls.c | |
=================================================================== | |
--- winctrls.c (revision 1322) | |
+++ winctrls.c (working copy) | |
@@ -829,8 +829,8 @@ | |
cf.hwndOwner = dlg.wnd; | |
cf.lpLogFont = &lf; | |
cf.Flags = | |
- CF_FIXEDPITCHONLY | CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT | | |
- CF_SCREENFONTS | CF_NOSCRIPTSEL; |
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
function Sync-Perforce($Path) | |
{ | |
Write-Host $Path | |
$arguement = "$($Path)/..."; | |
p4 sync $arguement 1>$null 2>&1; | |
if ($LASTEXITCODE -ne 0) { | |
$output = & p4 sync $arguement 2>&1; | |
if ($output.CategoryInfo.TargetName -eq "Request too large (over 750000); see 'p4 help maxresults'.") { | |
Write-Debug "Request too large! Retrying Subdirs"; | |
$SubDirs = &p4 dirs -C "$($Path)/*" |
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
$eventSubject = "Subject of event" # replace me with another Subject | |
$olFolderCalendar = 9 | |
$outlook = New-Object -ComObject Outlook.Application | |
$namespace = $outlook.GetNamespace('MAPI') | |
$calender = $namespace.GetDefaultFolder($olFolderCalendar) # | |
$totalEvents = ($calender.Items | where { $_.Subject -eq $eventSubject}).Count | |
if ($totalEvents) { | |
(($calender.Items | where { $_.Subject -eq $eventSubject } )[1..$totalEvents]) | % { $_.Delete() } | |
} |
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 | |
# -*- coding: utf-8 -*- | |
""" | |
Outputs some information on CUDA-enabled devices on your computer, | |
including current memory usage. | |
It's a port of https://gist.github.com/f0k/0d6431e3faa60bffc788f8b4daa029b1 | |
from C to Python with ctypes, so it can run without compiling anything. Note | |
that this is a direct translation with no attempt to make the code Pythonic. |
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
# https://blogs.technet.microsoft.com/heyscriptingguy/2007/02/03/hey-scripting-guy-how-can-i-use-windows-powershell-to-get-a-list-of-all-the-open-windows-on-a-computer/ | |
# https://stackoverflow.com/questions/4993926/maximize-window-and-bring-it-in-front-with-powershell | |
# Needs Powershell community extentions | |
Set-ForegroundWindow (get-process Spotify | Where-Object {$_.MainWindowTitle -ne ""}).MainWindowHandle |
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
# License: GPL | |
# Copyright: Miheer Vaidya ([email protected]) | |
import sys | |
import re | |
def getSpillOffsets(f) -> set: | |
""" | |
Given file `f' returns set of offsets of spill locations | |
""" | |
pattern = re.compile(r".* (-?\d+\(%rsp\)).*") |
OlderNewer