Skip to content

Instantly share code, notes, and snippets.

View Burakhan's full-sized avatar
🎯
Focusing

Burakhan Ozyol Burakhan

🎯
Focusing
View GitHub Profile
@hdogan
hdogan / is-animated-gif.php
Last active March 10, 2017 07:54
Detects animated GIF from given file pointer resource or filename.
<?php
/**
* Detects animated GIF from given file pointer resource or filename.
*
* @param resource|string $file File pointer resource or filename
* @return bool
*/
function is_animated_gif($file)
{
$fp = null;
@blacklee
blacklee / ffmpeg-to-480p.sh
Created February 19, 2016 13:43
ffmpeg convert video to 480p
ffmpeg -i input.mp4 -s hd480 -c:v libx264 -crf 23 -c:a aac -strict -2 output.mp4
@btroncone
btroncone / authentication.ts
Last active April 10, 2022 06:44
Angular 2 application role access decorator, wrapping built in CanAccess functionality. Prevents view transitions when user roles are not appropriate.
import { Injectable } from 'angular2/core';
import { Storage } from './storage';
import { CurrentUser } from '../interfaces/common';
@Injectable()
export class Authentication{
private _storageService : Storage;
private _userKey : string = "CURRENT_USER";
constructor(storageService : Storage){
// by Erik Wrenholt
import java.util.*;
class Mandelbrot
{
static int BAILOUT = 16;
static int MAX_ITERATIONS = 1000;
private static int iterate(float x, float y)
{
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 3, 2024 12:32
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@kimus
kimus / cx_oracle.md
Last active April 28, 2024 10:54
Installing python cx_oracle on Ubuntu

First of all, it just seems like doing anything with Oracle is obnoxiously painful for no good reason. It's the nature of the beast I suppose. cx_oracle is a python module that allows you to connect to an Oracle Database and issue queries, inserts, updates..usual jazz.

Linux

Step 1:

sudo apt-get install build-essential unzip python-dev libaio-dev

Step 2. Click here to download the appropriate zip files required for this. You'll need:

@birtanyildiz
birtanyildiz / gist:4756240
Last active December 12, 2015 09:59
Ubuntu 12.x heat , fan controll and monitoring
Decide and choice which graphic card that you want to use:
https://help.ubuntu.com/community/HybridGraphics
Heat Monitoring applet:
http://www.ubuntugeek.com/psensor-a-graphical-temperature-monitor.html
Jupiter light weight power control applet:
http://www.ubuntugeek.com/jupiter-light-weight-power-and-hardware-control-applet.html#more-13276
@hkulekci
hkulekci / yokVT.sql
Created April 26, 2012 06:13
üniversite - fakülte - bölüm
CREATE TABLE `yok_bolumler` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`fakulteId` varchar(40) NOT NULL,
`universiteId` int(6) NOT NULL,
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id`),
KEY `fakulteHash` (`fakulteId`)
) ENGINE=MyISAM;
INSERT INTO `yok_bolumler` (`id`, `fakulteId`, `universiteId`, `name`) VALUES
@ismailbaskin
ismailbaskin / postakodu.sql
Created April 24, 2012 05:06
İl - İlçe - semt - mahalle - posta kodu veritabanı
This file has been truncated, but you can view the full file.
DROP TABLE IF EXISTS `pk_il`;
CREATE TABLE `pk_il` (
`il_id` int(2) NOT NULL COMMENT 'plaka kodu',
`il_adi` varchar(255) NOT NULL,
PRIMARY KEY (`il_id`),
KEY `il_adi` (`il_adi`) USING BTREE
) ENGINE=MyISAM;
-- ----------------------------
INSERT INTO `pk_il` VALUES ('1', 'ADANA');
@worenga
worenga / MyEventListener.php
Created March 27, 2012 11:18
Doctrine2 Event Listener
<?php
namespace My\Bundle\Listener;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Events;
use Doctrine\ORM\Event\OnFlushEventArgs;
use Doctrine\ORM\Mapping\ClassMetadata;
use My\Bundle\Entity\Event;