Skip to content

Instantly share code, notes, and snippets.

View SelmanKahya's full-sized avatar
💭
^ flying

Selman Kahya SelmanKahya

💭
^ flying
View GitHub Profile
@bradtraversy
bradtraversy / docker-help.md
Last active September 23, 2024 03:01
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@colophonemes
colophonemes / create_triggers
Last active September 6, 2024 18:00
Postgres TRIGGER to call NOTIFY with a JSON payload
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
'email',
'username'
);
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
@SelmanKahya
SelmanKahya / gist:6973863
Last active February 22, 2024 11:08
simple example of using google dictionary word lookup. getMean() makes an ajax call to the api, then process function takes the result string and returns defination of the word as a json object.
function getMean(word){
if(word==""|| word=="Enter a word")
return;
ajax = new XMLHttpRequest();
// result callback
ajax.onreadystatechange = function(){
if(ajax.readyState==4 && ajax.status==200){
var massaged = ajax.responseText.replace(/^[^(]+\(|[^}]+$/g, ''), res;
@gennad
gennad / BFSDFS.java
Created January 23, 2011 09:14
Breadth-first search and depth-first search Java implementation
Class Main {
public void bfs()
{
// BFS uses Queue data structure
Queue queue = new LinkedList();
queue.add(this.rootNode);
printNode(this.rootNode);
rootNode.visited = true;
while(!queue.isEmpty()) {
Node node = (Node)queue.remove();
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/