Skip to content

Instantly share code, notes, and snippets.

View ecabuk's full-sized avatar
🐣

Evrim ecabuk

🐣
View GitHub Profile
class Node:
freq = None
left = None
right = None
letter = None
def __init__(self, freq, left=None, right=None, letter=None):
self.freq = freq
self.left = left
self.right = right
//Sample using LiquidCrystal library
#include <LiquidCrystal.h>
/*******************************************************
This program will test the LCD panel and the buttons
Mark Bramwell, July 2010
********************************************************/

Keybase proof

I hereby claim:

  • I am ecabuk on github.
  • I am ecabuk (https://keybase.io/ecabuk) on keybase.
  • I have a public key whose fingerprint is 7EBF 2BBA 347B 7464 4901 57A7 B44E F10E 14CD 343D

To claim this, I am signing this object:

@ecabuk
ecabuk / docker-clean.md
Last active June 23, 2016 14:34
Docker Cleanup Commands

Delete all 'untagged/dangling' () images

docker rmi $(docker images -q -f dangling=true)

Delete all orphaned volumes

docker volume rm $(docker volume ls -qf dangling=true)
@ecabuk
ecabuk / ubuntu_pxe_server.md
Created April 22, 2016 08:30
Ubuntu PXE Server Setup

Ubuntu PXE Server Setup

dnsmasq is the only required package to create a dhcp & tftp server.

sudo apt-get install dnsmasq

  • In /etc/dnsmasq.conf, add the lines:
dhcp-boot=pxelinux.0
@ecabuk
ecabuk / tooltipMixin.js
Created February 28, 2016 03:37
jQueryUI Tooltip Mixin for React
const $ = require('jquery'),
_ = require('lodash'),
ReactDOM = require('react-dom');
/**
* jQueryUI Tooltip Mixin Helper
*/
export default {
//tooltipOptions: {
// "input[title]": {
@ecabuk
ecabuk / pQuery.coffee
Last active February 6, 2016 00:52 — forked from niyazpk/pQuery.js
Add or update query string parameter
### Add / Update a key-value pair in the URL query parameters ###
updateUrlParameter = (uri, key, value)->
# Remove the hash part before operating on the uri
i = uri.indexOf('#')
hash = if i == -1 then '' else uri.substr(i)
uri = if i == -1 then uri else uri.substr(0, i)
re = new RegExp("([?&])" + key + "=.*?(&|$)", "i")
separator = if uri.indexOf('?') != -1 then "&" else "?"
if uri.match(re)
@ecabuk
ecabuk / winrar_install_on_mac.md
Created October 30, 2013 15:32
Install Winrar on Mac properly

Use the following command to install unrar:

sudo install -c -o $USER unrar /bin

$USER is a default environment variable in the bash shell which contains your username.

Sudo requires you to enter your user password. It’s the same password you use when you log in to Mac OS X. To install rar you can use the same command:

sudo install -c -o $USER rar /bin

Do a test-run to see if the installation went properly. In your terminal now enter from any location you want:

@ecabuk
ecabuk / JS Page Redirect.js
Last active October 2, 2015 04:17
JavaScript Page Redirect
// similar behavior as an HTTP redirect
window.location.replace("http://stackoverflow.com");
// similar behavior as clicking on a link
window.location.href = "http://stackoverflow.com";
//http://stackoverflow.com/a/506004/629760