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
#settings | |
DESCRIPTION_LEN = 5 | |
DESCRIPTION_SPLITTER = r'(?<=[.?!。!?])\s+' | |
#Modelis | |
def get_description(self, splitter = re.compile(settings.DESCRIPTION_SPLITTER)): | |
if self.short_content: | |
return self.short_content | |
else: | |
return ' '.join(splitter.split(self.content, settings.DESCRIPTION_LEN)[:-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
start = new Date(); | |
for(i=0; i<1000000; i++){String(Math.floor(Math.random()*1000000))}; | |
console.log(new Date()-start) | |
>> 2054 | |
start = new Date(); | |
for(i=0; i<1000000; i++){String(~~(Math.random()*1000000))}; | |
console.log(new Date()-start) | |
>> 1752 |
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
body{background:#ffffff;color:#111111;} | |
h1,h2,h3,h4,h5,h6{color:#222222;} | |
.content{box-shadow:0 0 5px #111111;-moz-box-shadow:0 0 5px #111111;-webkit-box-shadow:0 0 5px #111111;border:#000 solid;border-width:0 1px;} | |
#logo{background:url("http://kazlauskas.me/m/image/logo.svg") 100%;height:100px;} |
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
>> stash.set('a', function(){return true;}) | |
<< 1 | |
>> stash.add('a', 'adding string') //It shouldn't replace old value. | |
<< 1 | |
>> stash.get('a') //Unexpected value, we would expect old function. | |
<< "adding string" | |
//For people who may want replace action, they could use stash.cut(); and stash.set(); again. |
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
*.pyc | |
*.log | |
*.sql | |
*.sqlite | |
.DS_Store? | |
ehthumbs.db | |
Icon? | |
Thumbs.db | |
.gitignore |
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
Sep 6 16:39:05 localhost pulseaudio[1221]: alsa-sink.c: ALSA woke us up to write new data to the device, but there was actually nothing to write! | |
Sep 6 16:39:05 localhost pulseaudio[1221]: alsa-sink.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers. | |
Sep 6 16:39:05 localhost pulseaudio[1221]: alsa-sink.c: We were woken up with POLLOUT set -- however a subsequent snd_pcm_avail() returned 0 or another value < min_avail. | |
Sep 6 22:24:52 localhost pulseaudio[1221]: alsa-util.c: snd_pcm_avail() returned a value that is exceptionally large: 1176124 bytes (6667 ms). | |
Sep 6 22:24:52 localhost pulseaudio[1221]: alsa-util.c: Most likely this is a bug in the ALSA driver 'snd_hda_intel'. Please report this issue to the ALSA developers. |
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
#include <stdio.h> | |
#include <Python.h> | |
static PyObject * shit(PyObject *self, PyObject *args) | |
{ | |
signed long long int number; | |
signed long long int steps; | |
signed long long int i; | |
signed long long int the_biggest = 0; | |
for(i = 0; i < 1000000;i++) { |
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
header .search>form>input[type=submit]::-moz-focus-inner { | |
padding: 1px!important; | |
} |
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 | |
. /etc/rc.conf | |
. /etc/rc.d/functions | |
# get the number of CPUs | |
num_cpus=`grep -c processor /proc/cpuinfo` | |
# set decremented number of CPUs | |
decr_num_cpus=`expr $num_cpus - 1` |
OlderNewer