Skip to content

Instantly share code, notes, and snippets.

View CanNuhlar's full-sized avatar
💭
I may be slow to respond.

Can Nuhlar CanNuhlar

💭
I may be slow to respond.
View GitHub Profile
#include <fstream>
#include <iostream>
#include <unistd.h>
#include <math.h>
#include <sstream>
using namespace std;
struct XYZAxisStruct{
int xAxis;
@CanNuhlar
CanNuhlar / 20-nvidia.conf
Created September 30, 2018 13:46
Created from terminal
Section "Device"
Identifier "Device0"
VendorName "NVIDIA Corporation"
Option "Coolbits" "28"
EndSection
# This is a trailing line, it is needed so that End Section is not the last line
@CanNuhlar
CanNuhlar / xponent
Created September 30, 2018 08:01
Created from terminal
#!/usr/bin/pulseaudio -nF
#
# This file is part of PulseAudio.
#
# PulseAudio is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# PulseAudio is distributed in the hope that it will be useful, but
@CanNuhlar
CanNuhlar / 55numlockx
Created August 7, 2018 11:44
Created from terminal
# X session startup script: /etc/X11/Xsession.d/55numlockx
# Initial settings
NUMLOCK=auto
# Load configuration
cf=/etc/default/numlockx
[ ! -r $cf ] || . $cf
# Toggle numlock if we're not removed
@CanNuhlar
CanNuhlar / TDK_Scraper.py
Created August 2, 2018 19:57
Created from terminal
# -*- coding: utf-8 -*-
import requests
from HTMLParser import HTMLParser
import re
class PageNumParser(HTMLParser):
def handle_data(self, data):
if "sayfanın" in data:
getContent(int(re.search(r'\d+', data).group()))
class wordParser(HTMLParser):
@CanNuhlar
CanNuhlar / .bashrc
Created July 29, 2018 20:18
Created from terminal
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@CanNuhlar
CanNuhlar / NMOS.asc
Created March 12, 2018 16:45
LTSpice IV NMOS Schematic
Version 4
SHEET 1 880 680
WIRE 192 -16 64 -16
WIRE 256 -16 192 -16
WIRE 64 48 64 -16
WIRE 256 48 256 -16
WIRE 128 96 64 96
WIRE -32 128 -80 128
WIRE 16 128 -32 128
WIRE -80 160 -80 128
@CanNuhlar
CanNuhlar / localize_date.php
Last active July 29, 2018 20:24
Localize date from an English default string to Turkish using PHP
<?
function localize_date($date){
$days = array("Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun");
$months = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
$daysLocal = array("Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi", "Pazar");
$monthsLocal = array("Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık");