Skip to content

Instantly share code, notes, and snippets.

View denysonique's full-sized avatar

Dennis Prochniak denysonique

View GitHub Profile
{
"presets": [
[
"@babel/env",
{
"modules": "commonjs"
}
],
[
"@babel/typescript", {
# cat ~/chroot-ubuntu.sh
mount /ubuntu
mount --rbind /dev /ubuntu/dev
mount --rbind /proc /ubuntu/proc
mount --rbind /sys /ubuntu/sys
mount --rbind /home /ubuntu/home
mount --rbind /run /ubuntu/run
chroot /ubuntu
[Unit]
Description=preload daemon
After=syslog.target
[Service]
ExecStart=/usr/sbin/preload -c /etc/preload.conf -s /var/lib/preload/preload.state -l /var/log/preload.log
Type=forking
[Install]
WantedBy=multi-user.target
function fibonacci(n, cb) {
console.log(n)
if (n < 2)
cb(1);
else
fibonacci(n-2, function(wynik) {
fibonacci(n-1, function(wynik2) {
cb(wynik + wynik2)
})
})
var request = require('request');
var cheerio = require('cheerio');
var pages, channel, link, url, page, week, songCount, list;
getMusic = function (link, pages, callfuck) {
console.log('Initializing Music retrieval...');
for (pageX = 0; pageX <= pages; pageX++) {
url = link + pageX;
console.log(url, pageX);
var request = require('request');
var cheerio = require('cheerio');
var pages, channel, link, url, page, week, songCount, list;
getMusic = function (link, pages, callfuck) {
console.log('Initializing Music retrieval...');
for (pageX = 0; pageX <= pages; pageX++) {
url = link + pageX;
console.log(url, pageX);
getMusic = function (link, pages) {
console.log('Initializing Music retrieval...');
for (pageX = 0; pageX <= pages; pageX++) {
url = link + pageX;
getPage(pageX);
};
};
function getPage (pageX) {
console.log('enter get page');
setTimout ->
$('#foo').fadeOut 200, ->
$('.bar').css background: 'red'
console.log 'done'
,1000
# VS
delay = (ms, cb)-> setTimeout(cb, ms)
@denysonique
denysonique / ruby.vim
Created August 3, 2013 18:21
when Ruby file run with Ruby, when Gemfile run bundle
set shiftwidth=2
set softtabstop=2
function Rb_or_gemfile()
if bufname('%') == 'Gemfile'
execute '!bundle'
else
execute '!ruby %'
endif
endfunction
require 'scrapify'
require 'models'
module HN
class Scraper < Scrapify::Page
encoding 'utf-8'
fields = {