Skip to content

Instantly share code, notes, and snippets.

@roktas
roktas / gist:4f10793e8a3772b5a10e2cc7e9005528
Created October 17, 2023 12:02 — forked from fernandoaleman/gist:5083680
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.
@roktas
roktas / stub.rs
Created January 30, 2022 17:44 — forked from iximeow/stub.rs
glue between nasm and exec
use std::io::Write;
use std::process::Command;
extern "C" {
fn mprotect(addr: *const u8, len: usize, prot: u32) -> u32;
}
fn main() {
let mut args = std::env::args();
let _ = args.next();
@roktas
roktas / calendar_title.rb
Created November 22, 2018 10:23 — forked from ecmelkytz/calendar_title.rb
Calender event concern
# frozen_string_literal: true
class CalendarTitle < ApplicationRecord
include EventTitle
# search
include PgSearch
pg_search_scope(
:search,
against: %i[name],
@roktas
roktas / calendar_event.rb
Created November 21, 2018 12:48 — forked from ecmelkytz/calendar_event.rb
Akademik takvim tarih aralıkları
class CalendarEvent < ApplicationRecord
def proper_range?
Time.zone.now >= start_date && Time.zone.now <= end_date
end
end
@roktas
roktas / TODO.md
Last active January 9, 2017 19:53 — forked from huseyin/TODO.md
  • a task list item
  • list syntax required
  • normal formatting, @mentions, #1234 refs
  • incomplete
  • completed
@roktas
roktas / Makefile
Created October 24, 2015 10:40 — forked from anonymous/Makefile
html: bar.html
%.html: %.md
pandoc $< -o $@
pdf:
pandoc bar.md -o bar.pdf
clean:
rm -f *.html *.pdf
@roktas
roktas / main.go
Last active August 29, 2015 14:27 — forked from TheHippo/main.go
Benchmarking Go Mutex overhead
package main
import (
"fmt"
"sync"
)
type unlocked struct {
i int
}
from random import randrange
import time
def kelime2():
puan=0
list1=['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','r','s','t','u','v','w','x','y','z']
list2=['a','a','a','a','a','a','a','a','a']
list3=['a','a','a','a','a','a','a','a','a']
@roktas
roktas / card.go
Last active June 7, 2017 18:24 — forked from ecylmz/card.go
package main
import (
"fmt"
"sort"
"math/rand"
"time"
"strings"
)
@roktas
roktas / fiddle.css
Created April 8, 2012 12:15
Google Maps JavaScript API v3 - Multiple Animated Map
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#harita_canvas { height: 100% }