Skip to content

Instantly share code, notes, and snippets.

CREATE TABLE for_ddl LIKE foo;
ALTER TABLE for_ddl DROP INDEX bar;
more ddl...
LOCK TABLES foo WRITE;
RENAME TABLE foo TO old_foo;
RENAME TABLE for_ddl TO for_ddl;
DROP TABLE old_foo;
UNLOCK TABLES;
/* simple fork test sorry =( */
array
'Spor' =>
array
0 =>
array
'haberID' => string '149' (length=3)
'sablonbaslik' => string 'Kulüpler Birliği Demirören başkanlığında toplandı... adına ile alakalı yazılan fikirler' (length=98)
'baslik' => string 'Kulüpler Birliği Demirören başkanlığında toplandı...' (length=60)
'ozet' => string 'Kulüpler Birliği Demirören başkanlığında toplandı... haberi için Milliyet sitesinde bugün yayınlanmış haberi görmek veya incelemekiçin burdaki adresi tıklayabilrisiniz.' (length=184)
'sablonbasliksef' => string 'kulupler-birligi-demiroren-baskanliginda-toplandi-adina-ile-alakali-yazilan-fikirler' (length=84)
@cnra
cnra / youtubetemizle
Created April 30, 2013 14:56
youtube temizle macro su. 30 saniye bekleyip başa sarıyo. ama ilgili kısmı silersen sarmaz :D .
// ==UserScript==
// @name http://www.youtube.com/my_videos?o=U*
// @namespace http://www.youtube.com/my_videos?o=U*
// @description http://www.youtube.com/my_videos?o=U*
// @include http://www.youtube.com/my_videos?o=U*
#include <iostream>
using namespace std;
class TemelSinif{
public:
int fonk1() { return 2; }
virtual int fonk2() { return 4; }
};
#include <iostream>
using namespace std;
class A {
public:
A() { cout << "A yapici\n"; }
A(const A &x) { cout << "A Kopya\n"; }
~A() { cout << "A Yikici\n"; }
};
@cnra
cnra / Vagrantfile.rb
Last active September 17, 2018 08:59
Vagrantfile Ornek #vagrant
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.network "public_network"
config.vm.synced_folder "d:/code", "/code"
end
@cnra
cnra / reflect.py
Last active September 17, 2018 09:00 — forked from huyng/reflect.py
A simple echo #server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
@cnra
cnra / express-basic.js
Created September 27, 2018 09:07
express basic #server
const express = require('express')
const app = express()
const port = 8080
app.get('/', (req, res) => {
js = {}
js.time = new Date();
js.remoteAddress = req.connection.remoteAddress;
js.ip = req.ip;
res.json(js);
@cnra
cnra / docker-machine static ip.sh
Last active February 24, 2019 19:30
docker machine static ip
docker-machine ssh dev1
echo "ifconfig eth1 192.168.99.100 netmask 255.255.255.0 broadcast 192.168.99.255 up" > /var/lib/boot2docker/bootsync.sh
echo -e 'kill `more /var/run/udhcpc.eth1.pid`\nifconfig eth1 192.168.99.100 netmask 255.255.255.0 broadcast 192.168.99.255 up' > /var/lib/boot2docker/bootsync.sh
docker-machine regenerate-certs dev
https://github.com/docker/machine/issues/1709#issuecomment-169293713
for iommu_group in $(find /sys/kernel/iommu_groups/ -maxdepth 1 -mindepth 1 -type d); do
echo "IOMMU group $(basename "$iommu_group")";
for device in $(ls -1 "$iommu_group"/devices/); do echo -n $'\t'; lspci -nns "$device";
done;
done