Skip to content

Instantly share code, notes, and snippets.

sc.exe create MongoDB binPath= "\"C:\Program Files\MongoDB\Server\3.6\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB\Server\3.6\mongod.cfg\"" DisplayName="MongoDb" start="auto"
@abznak
abznak / tensorflow_cuda_osx.md
Created March 13, 2018 22:41 — forked from Mistobaan/tensorflow_cuda_osx.md
How to enable cuda support for tensor flow on Mac OS X (Updated on April:2016 Tensorflow 0.8)

These instructions will explain how to install tensorflow on mac with cuda enabled GPU suport. I assume you know what tensorflow is and why you would want to have a deep learning framework running on your computer.

Prerequisites

Make sure to update your homebrew formulas

brew update
@abznak
abznak / gist:33a63d0b5f017dd849f7d072e19a2ed9
Created May 18, 2016 05:31
assigning to nil as an array
15:23:14 tims@firebat ~ $ rvm use 2.2.1
Using /home/tims/.rvm/gems/ruby-2.2.1
15:23:18 tims@firebat ~ $ irb
2.2.1 :001 > "#{RUBY_VERSION}-p#{RUBY_PATCHLEVEL}"
=> "2.2.1-p85"
2.2.1 :002 > a = nil
=> nil
2.2.1 :003 > a[5] = 6
NoMethodError: undefined method `[]=' for nil:NilClass
from (irb):3
she told him that she loved him
only she told him that she loved him
she only told him that she loved him
only she only told him that she loved him
she told only him that she loved him
only she told only him that she loved him
she only told only him that she loved him
only she only told only him that she loved him
she told him only that she loved him
only she told him only that she loved him
Twitter won't let me send this tweet, it claims "This request looks like it might be automated. To protect our users from spam and other malicious activity, we can't complete this action right now. Please try again later."
I think this is the article on character encoding I'm looking for. #ruby
https://web.archive.org/web/20140807044211/http://graysoftinc.com/articles/ruby_19s_string
@abznak
abznak / gist:7c392f92005ac3fceff3
Created June 23, 2014 05:44
on PHP and foreach by reference
04:46:58 tims@saw ~ $ cat test.php
<?php
$a = array(1,2,3,4);
#http://www.php.net//manual/en/control-structures.foreach.php
# "Warning Reference of a $value and the last array element remain even after the foreach loop. It is recommended to destroy it by unset()"
foreach ($a as &$b) {
$b = $b * 2;
}
@abznak
abznak / index.php
Created November 16, 2012 03:49
very quick image gallery script
<html><body>
<?php
$msg = file_get_contents('readme.txt');
echo "<pre>$msg\n\n</pre>";
foreach (glob("*") as $img) {
if (preg_match("/jpg|png|gif/i", $img)) {
echo "<img src=\"$img\"><br>";
}
}
<?php
$a = '1E1';
$b = $a - (int)$a;
var_dump($b);
//output: float(9)
@abznak
abznak / floats.php
Created June 28, 2011 06:55
lesson - do not use floats for money
<?php
#don't use floats for money!
$a = 110; # $110
$b = 1.10 * 100; # 100 items at $1.10 each
#$b = 110 -1E-13;
print "a: "; var_dump($a);
print "b: "; var_dump($b);
@abznak
abznak / ozymandias.txt
Created March 20, 2011 11:33
OZYMANDIAS by Percy Bysshe Shelley
OZYMANDIAS
by Percy Bysshe Shelley. via http://en.wikipedia.org/wiki/Ozymandias
I met a traveller from an antique land
Who said: Two vast and trunkless legs of stone
Stand in the desert. Near them, on the sand,
Half sunk, a shattered visage lies, whose frown
And wrinkled lip, and sneer of cold command
Tell that its sculptor well those passions read
Which yet survive, stamped on these lifeless things,